mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 21:35:44 +08:00
libblock: Add read-ahead task
Read-ahead requests were previously executed in the context of the reading task. This blocks the reading task until the complete read with read-ahead transfer is finished. A read-ahead task is introduced to off-load the read-ahead transfer. This allows the reading task to work with the requested block more quickly. The read-ahead is triggered after two misses of ascending consecutive blocks or a read hit of a block read by the most-recent read-ahead transfer. The read-ahead feature is configurable and can be disabled.
This commit is contained in:
@@ -1241,6 +1241,10 @@ rtems_fs_init_functions_t rtems_fs_init_helper =
|
||||
#define CONFIGURE_BDBUF_BUFFER_MAX_SIZE \
|
||||
RTEMS_BDBUF_BUFFER_MAX_SIZE_DEFAULT
|
||||
#endif
|
||||
#ifndef CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY
|
||||
#define CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY \
|
||||
RTEMS_BDBUF_READ_AHEAD_TASK_PRIORITY_DEFAULT
|
||||
#endif
|
||||
#ifdef CONFIGURE_INIT
|
||||
const rtems_bdbuf_config rtems_bdbuf_configuration = {
|
||||
CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS,
|
||||
@@ -1253,11 +1257,14 @@ rtems_fs_init_functions_t rtems_fs_init_helper =
|
||||
CONFIGURE_BDBUF_TASK_STACK_SIZE,
|
||||
CONFIGURE_BDBUF_CACHE_MEMORY_SIZE,
|
||||
CONFIGURE_BDBUF_BUFFER_MIN_SIZE,
|
||||
CONFIGURE_BDBUF_BUFFER_MAX_SIZE
|
||||
CONFIGURE_BDBUF_BUFFER_MAX_SIZE,
|
||||
CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY
|
||||
};
|
||||
#endif
|
||||
|
||||
#define CONFIGURE_LIBBLOCK_TASKS (1 + CONFIGURE_SWAPOUT_WORKER_TASKS)
|
||||
#define CONFIGURE_LIBBLOCK_TASKS \
|
||||
(1 + CONFIGURE_SWAPOUT_WORKER_TASKS + \
|
||||
(CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS != 0))
|
||||
|
||||
#define CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS \
|
||||
(CONFIGURE_LIBBLOCK_TASKS * \
|
||||
|
||||
Reference in New Issue
Block a user