• Andrew Morton's avatar
    [PATCH] fix hangs with nfs to localhost · b91404d3
    Andrew Morton authored
    An NFS mount of localhost hangs the system under heavy writeout loads.
    
    This is because knfsd gets stuck in balance_dirty_pages().  It is not allowed
    to exit from there until the amount of dirty+writeback+unstable memory
    subsides.  But it will never subside because knfsd itself is responsible for
    cleaning the memory.
    
    This is just like the drivers/block/loop.c hang, only more complex.  We
    cannot simply disable knfsd's throttling because it would then swamp the
    machine under real loads when the clients are remote.
    
    So we introduce the concept of a "less throttled" process.  These processes
    are allowed to exceed the preset dirty memory limits by a little.  This
    allows knfsd to make progrws in writing things out while the local NFS
    clients are throttled.  It also ensures that knfsd will not swamp the machine
    when working on behalf of remote clients.
    
    Note that even though knfsd is allowed to exceed the default system-wide
    dirty memory threshold, this does _not_ cause other memory-dirtying tasks to
    get starved out.  This is because they are allowed to exit
    balance_dirty_pages() after having written their quota of pages, regardless
    of the current dirty memory state.
    b91404d3
nfssvc.c 8.53 KB