• Andrew Morton's avatar
    [PATCH] exact dirty state accounting · 1f90eedd
    Andrew Morton authored
    Some adjustments to global dirty page accounting.
    
    Previously, dirty page accounting counted all dirty pages.  Even dirty
    anonymous pages.  This has potential to upset the throttling logic in
    balance_dirty_pages().  Particularly as I suspect we should decrease
    the dirty memory writeback thresholds by a lot.
    
    So this patch changes it so that we only account for dirty pagecache
    pages which have backing store.  Not anonymous pages, not swapcache,
    not in-memory filesystem pages.
    
    To support this, the `memory_backed' boolean has been added to struct
    backing_dev_info.  When an address space's backing device is marked as
    memory-backed, the core kernel knows to not include that mapping's
    pages in the dirty memory accounting.
    
    For memory-backed mappings, dirtiness is a way of pinning the page, and
    there's nothing the kernel can to do clean the page to make it freeable.
    
    driverfs, tmpfs, and ranfs have been coverted to mark their mappings as
    memory-backed.
    
    The ramdisk driver hasn't been converted.  I have a separate patch for
    ramdisk, which fails to fix the longstanding problems in there :(
    
    With this patch, /bin/sync now sends /proc/meminfo:Dirty to zero, which
    is rather comforting.
    1f90eedd
mpage.c 17 KB