• Andrew Morton's avatar
    [PATCH] block request batching · 930805a2
    Andrew Morton authored
    From: Nick Piggin <piggin@cyberone.com.au>
    
    The following patch gets batching working how it should be.
    
    After a process is woken up, it is allowed to allocate up to 32 requests
    for 20ms.  It does not stop other processes submitting requests if it isn't
    submitting though.  This should allow less context switches, and allow
    batches of requests from each process to be sent to the io scheduler
    instead of 1 request from each process.
    
    tiobench sequential writes are more than tripled, random writes are nearly
    doubled over mm1.  In earlier tests I generally saw better CPU efficiency
    but it doesn't show here.  There is still debug to be taken out.  Its also
    only on UP.
    
                                    Avg     Maximum     Lat%   Lat%   CPU
     Identifier    Rate  (CPU%)  Latency   Latency     >2s    >10s   Eff
     ------------------- ------ --------- ---------- ------- ------ ----
     -2.5.71-mm1   11.13 3.783%    46.10    24668.01   0.84   0.02   294
     +2.5.71-mm1   13.21 4.489%    37.37     5691.66   0.76   0.00   294
    
     Random Reads
     ------------------- ------ --------- ---------- ------- ------ ----
     -2.5.71-mm1    0.97 0.582%   519.86     6444.66  11.93   0.00   167
     +2.5.71-mm1    1.01 0.604%   484.59     6604.93  10.73   0.00   167
    
     Sequential Writes
     ------------------- ------ --------- ---------- ------- ------ ----
     -2.5.71-mm1    4.85 4.456%    77.80    99359.39   0.18   0.13   109
     +2.5.71-mm1   14.11 14.19%    10.07    22805.47   0.09   0.04    99
    
     Random Writes
     ------------------- ------ --------- ---------- ------- ------ ----
     -2.5.71-mm1    0.46 0.371%    14.48     6173.90   0.23   0.00   125
     +2.5.71-mm1    0.86 0.744%    24.08     8753.66   0.31   0.00   115
    
    It decreases context switch rate on IBM's 8-way on ext2 tiobench 64 threads
    from ~2500/s to ~140/s on their regression tests.
    930805a2
ll_rw_blk.c 68.6 KB