Changeset f29d969 in rtems


Ignore:
Timestamp:
Jul 2, 2012, 2:06:10 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
1fb0e2d, c8a86d4d
Parents:
f12249f
git-author:
Sebastian Huber <sebastian.huber@…> (07/02/12 14:06:10)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/02/12 14:15:54)
Message:

libblock: Fix read-ahead trigger and next update

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/src/bdbuf.c

    rf12249f rf29d969  
    30283028          {
    30293029            transfer_count = max_transfer_count;
    3030             dd->read_ahead.trigger += max_transfer_count / 2 + 1;
    3031             dd->read_ahead.next += max_transfer_count;
     3030            dd->read_ahead.trigger = block + (transfer_count + 1) / 2;
     3031            dd->read_ahead.next = block + transfer_count;
    30323032          }
    30333033          else
  • testsuites/libtests/block13/block13.scn

    rf12249f rf29d969  
    11*** TEST BLOCK 13 ***
    2 0 2 3 4 5 6 7 8
     20 2 3 4 5 6 7 8 9 10
     3reset
     410
     5reset
     69
    37reset
    488
    59reset
    6 7
     107 8
    711reset
    8 6 7
    9 reset
    10 5 6 8
     126 7 10
    1113*** END OF TEST BLOCK 13 ***
  • testsuites/libtests/block13/init.c

    rf12249f rf29d969  
    2525#include <rtems/bdbuf.h>
    2626
    27 #define BLOCK_COUNT 9
    28 #define READ_COUNT 19
     27#define BLOCK_COUNT 11
     28#define READ_COUNT 23
    2929
    3030static int block_access_counts [BLOCK_COUNT];
     
    3333
    3434static const int action_sequence [READ_COUNT] = {
    35   0, 2, 3, 4, 5, 6, 7, 8,
     35  0, 2, 3, 4, 5, 6, 7, 8, 9, 10,
     36  RESET_CACHE,
     37  10,
     38  RESET_CACHE,
     39  9,
    3640  RESET_CACHE,
    3741  8,
    3842  RESET_CACHE,
    39   7,
    40   RESET_CACHE,
    41   6, 7,
    42   RESET_CACHE,
    43   5, 6, 8
    44 };
    45 
    46 #define UNUSED_LINE { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
     43  7, 8,
     44  RESET_CACHE,
     45  6, 7, 10
     46};
     47
     48#define UNUSED_LINE { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
    4749
    4850static const int expected_block_access_counts [READ_COUNT] [BLOCK_COUNT] = {
    49    { 1, 0, 0, 0, 0, 0, 0, 0, 0 },
    50    { 1, 0, 1, 0, 0, 0, 0, 0, 0 },
    51    { 1, 0, 1, 1, 1, 1, 0, 0, 0 },
    52    { 1, 0, 1, 1, 1, 1, 0, 0, 0 },
    53    { 1, 0, 1, 1, 1, 1, 1, 1, 0 },
    54    { 1, 0, 1, 1, 1, 1, 1, 1, 0 },
    55    { 1, 0, 1, 1, 1, 1, 1, 1, 1 },
    56    { 1, 0, 1, 1, 1, 1, 1, 1, 1 },
    57    UNUSED_LINE,
    58    { 0, 0, 0, 0, 0, 0, 0, 0, 1 },
    59    UNUSED_LINE,
    60    { 0, 0, 0, 0, 0, 0, 0, 1, 0 },
    61    UNUSED_LINE,
    62    { 0, 0, 0, 0, 0, 0, 1, 0, 0 },
    63    { 0, 0, 0, 0, 0, 0, 1, 1, 1 },
    64    UNUSED_LINE,
    65    { 0, 0, 0, 0, 0, 1, 0, 0, 0 },
    66    { 0, 0, 0, 0, 0, 1, 1, 1, 1 },
    67    { 0, 0, 0, 0, 0, 1, 1, 1, 1 }
     51   { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
     52   { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
     53   { 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 },
     54   { 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 },
     55   { 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 },
     56   { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
     57   { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
     58   { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
     59   { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
     60   { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
     61   UNUSED_LINE,
     62   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
     63   UNUSED_LINE,
     64   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
     65   UNUSED_LINE,
     66   { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
     67   UNUSED_LINE,
     68   { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 },
     69   { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 },
     70   UNUSED_LINE,
     71   { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
     72   { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1 },
     73   { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1 }
    6874};
    6975
     
    7379
    7480static const rtems_blkdev_bnum trigger [READ_COUNT] = {
    75   1, 3, 5, 5, 7, 7, NO_TRIGGER, NO_TRIGGER,
     81  1, 3, 6, 6, 6, 9, 9, 9, NO_TRIGGER, NO_TRIGGER,
     82  TRIGGER_AFTER_RESET,
     83  11,
     84  TRIGGER_AFTER_RESET,
     85  10,
    7686  TRIGGER_AFTER_RESET,
    7787  9,
    7888  TRIGGER_AFTER_RESET,
    79   8,
    80   TRIGGER_AFTER_RESET,
    81   7, NO_TRIGGER,
    82   TRIGGER_AFTER_RESET,
    83   6, 8, NO_TRIGGER
     89  8, NO_TRIGGER,
     90  TRIGGER_AFTER_RESET,
     91  7, 10, NO_TRIGGER
    8492};
    8593
     
    8795
    8896static const rtems_blkdev_bnum next [READ_COUNT] = {
    89   2, 4, 6, 6, 8, 8, 8, 8,
    90   NOT_CHANGED_BY_RESET(8),
     97  2, 4, 7, 7, 7, 10, 10, 10, 10, 10,
     98  NOT_CHANGED_BY_RESET(10),
     99  12,
     100  NOT_CHANGED_BY_RESET(12),
     101  11,
     102  NOT_CHANGED_BY_RESET(11),
    91103  10,
    92104  NOT_CHANGED_BY_RESET(10),
    93   9,
     105  9, 9,
    94106  NOT_CHANGED_BY_RESET(9),
    95   8, 8,
    96   NOT_CHANGED_BY_RESET(8),
    97   7, 9, 9
     107  8, 11, 11
    98108};
    99109
     
    216226#define CONFIGURE_BDBUF_BUFFER_MAX_SIZE 1
    217227#define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE BLOCK_COUNT
    218 #define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS 2
     228#define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS 3
    219229#define CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY 1
    220230
Note: See TracChangeset for help on using the changeset viewer.