• Andrew Morton's avatar
    [PATCH] JBD: checkpointing optimisations · a2df663d
    Andrew Morton authored
    From: Alex Tomas <bzzz@tmi.comex.ru>
    
    Some transaction checkpointing improvements for the JBD commit phase.  Decent
    speedups:
    
    creation of 500K files in single dir (with htree, of course):
     before: 4m16.094s, 4m12.035s, 4m11.911s
     after:  1m41.364s, 1m43.461s, 1m45.189s
    
    removal of 500K files in single dir:
     before: 43m50.161s
     after:  38m45.510s
    
    
    - Make __log_wait_for_space() recalculate the needed blocks because journal
      free space changes during commit
    
    - Make log_do_checkpoint() starts scanning from the oldest transaction
    
    - Make log_do_checkpoint() stop scanning if a transaction gets dropped.
      The caller will reevaluate the transaction state and decide whether more
      space needs to be generated in the log.
    
      The effect of this is to smooth out the I/O patterns, avoid the huge
      stop-and-go which currently happens when forced checkpointing writes out
      and waits upon 3/4 of the journal's size worth of data.
    a2df663d
checkpoint.c 17.2 KB