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:
Sebastian Huber
2012-06-04 09:54:31 +02:00
parent 6273201b14
commit 39ee704e75
11 changed files with 568 additions and 130 deletions
+9 -2
View File
@@ -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 * \