• Andrew Morton's avatar
    [PATCH] dirty inode writeback fix · eebef30c
    Andrew Morton authored
    Both sys_sync() and the kupdate function need to precalculate the number of
    pages which they are prepared to write.  Mainly for livelock avoidance.
    
    But they also must write inodes, and dirty inodes do not contribute to dirty
    page accounting (oops).  Net effect: when there are lots of dirty inodes and
    few dirty pages, we forget to write inodes.
    
    This mainly affects atime updates, because most other inode-dirtying activity
    will generate dirty pages too.
    
    It mainly affects ext2.
    
    
    Now, writing an ext2 inode will just dirty the underlying blockdev pagecache
    page.  So what the patch does is to assume that writing one inode will dirty
    up to one pagecache page.  So the patch adds (inodes_stat.nr_inodes -
    inodes_stat.nr_unused) into the number of pages to be written.
    
    I considered creating inodes_stat.nr_dirty.  It looks fairly messy, needing
    to know not to account for memory-backed inodes, etc.  But it is probably a
    better thing to do.
    eebef30c
fs-writeback.c 16.8 KB