• Andrew Morton's avatar
    [PATCH] reduce the dirty threshold when there's a lot of mapped · 3f0a2357
    Andrew Morton authored
    Dirty memory thresholds are currently set by /proc/sys/vm/dirty_ratio.
    
    Background writeout levels are controlled by
    /proc/sys/vm/dirty_background_ratio.
    
    Problem is that these levels are hard to get right - they are too
    static.  If there is a lot of mapped memory around then the 40%
    clamping level causes too much dirty data.  We do lots of scanning in
    page reclaim, and the VM generally starts getting into distress.  Extra
    swapping, extra page unmapping.
    
    It would be much better to simply tell the caller of write(2) to slow
    down - to write out their dirty data sooner, to make those written
    pages trivially reclaimable.  Penalise the offender, not the innocent
    page allocators.
    
    This patch changes the writer throttling code so that we clamp down
    much harder on writers if there is a lot of mapped memory in the
    machine.  We only permit memory dirtiers to dirty up to 50% of unmapped
    memory before forcing them to clean their own pagecache.
    3f0a2357
page-writeback.c 18.6 KB