• Andrew Morton's avatar
    [PATCH] block batching fairness · 80af89ca
    Andrew Morton authored
    From: Nick Piggin <piggin@cyberone.com.au>
    
    This patch fixes the request batching fairness/starvation issue.  Its not
    clear what is going on with 2.4, but it seems that its a problem around this
    area.
    
    Anyway, previously:
    
    	* request queue fills up
    	* process 1 calls get_request, sleeps
    	* a couple of requests are freed
    	* process 2 calls get_request, proceeds
    	* a couple of requests are freed
    	* process 2 calls get_request...
    
    Now as unlikely as it seems, it could be a problem.  Its a fairness problem
    that process 2 can skip ahead of process 1 anyway.
    
    With the patch:
    
    	* request queue fills up
    	* any process calling get_request will sleep
    	* once the queue gets below the batch watermark, processes
    	  start being worken, and may allocate.
    
    
    This patch includes Chris Mason's fix to only clear queue_full when all tasks
    have been woken.  Previously I think starvation and unfairness could still
    occur.
    
    With this change to the blk-fair-batches patch, Chris is showing some much
    improved numbers for 2.4 - 170 ms max wait vs 2700ms without blk-fair-batches
    for a dbench 90 run.  He didn't indicate how much difference his patch alone
    made, but it is an important fix I think.
    80af89ca
blkdev.h 17.5 KB