#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:
Blocking:

Description

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 02/11/19 at 10:49:48.
Prototoype implementation.

Download all attachments as: .zip

Change History (8)

Changed on 02/11/19 at 10:49:48 by Sebastian Huber

Prototoype implementation.

comment:1 Changed on 02/11/19 at 11:03:03 by Chris Johns

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

comment:2 Changed on 02/11/19 at 11:04:30 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 02/11/19 at 11:09:51 by Chris Johns

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

comment:4 Changed on 12/19/19 at 08:07:34 by Sebastian Huber

Milestone: 5.16.1

comment:5 Changed on 03/26/21 at 13:28:22 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 03/26/21 at 13:28:26 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 04/07/21 at 05:04:32 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.