#3689 closed enhancement (fixed)

bdbuf: Replace automatic read-ahead with rtems_bdbuf_peek()

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 6.1
Component: lib/block Version: 5
Severity: normal Keywords:
Cc: Blocked By:


The block device cache (bdbuf) tries to deduce a read ahead opportunity from the read access pattern. Using real world FAT file systems showed that this is not very reliable and the read ahead seldom happens. One way to fix this issue is let file systems give a hint to the block device cache that they will likely read a certain block in the future, e.g. the next block in a sequential file read. Remove the existing read ahead logic and add a new function rtems_bdbuf_peek() instead.

Attachments (1)

0001-FIXME-bdbuf-Add-rtems_bdbuf_peek.patch (5.2 KB) - added by Sebastian Huber on Feb 11, 2019 at 10:49:48 AM.
Prototoype implementation.

Download all attachments as: .zip

Change History (8)

Changed on Feb 11, 2019 at 10:49:48 AM by Sebastian Huber

Prototoype implementation.

comment:1 Changed on Feb 11, 2019 at 11:03:03 AM by Chris Johns

Why is the status returned from the peek in fat_file_read not checked?

comment:2 Changed on Feb 11, 2019 at 11:04:30 AM by Sebastian Huber

The data is not used yet. It is just a hint, maybe we should remove a return code from rtems_bdbuf_peek().

comment:3 Changed on Feb 11, 2019 at 11:09:51 AM by Chris Johns

I would not remove the return code, it may be used in another file system.

comment:4 Changed on Dec 19, 2019 at 8:07:34 AM by Sebastian Huber

Milestone: 5.16.1

comment:5 Changed on Mar 26, 2021 at 1:28:22 PM by Christian Mauderer <christian.mauderer@…>

In 6ae79e6/rtems:

libblock: Add rtems_bdbuf_peek()

Adds a peek function that allows (for example) a file system to suggest
the next blocks that should be used for read ahead. This can increase
the read speed of fragmented files.

Update #3689

comment:6 Changed on Mar 26, 2021 at 1:28:26 PM by Christian Mauderer <christian.mauderer@…>

Resolution: fixed
Status: assignedclosed

In fd639b8/rtems:

dosfs: Use peek support

This speeds up reading fragmented files.

Fix #3689

comment:7 Changed on Apr 7, 2021 at 5:04:32 AM by Sebastian Huber <sebastian.huber@…>

In b3364fc6/rtems:

libtests/block14: Fix warning

Fix warning:

testsuites/libtests/block14/init.c:198:8: warning: 'sc' may be used

uninitialized in this function [-Wmaybe-uninitialized]

Update #3689.

Note: See TracTickets for help on using tickets.