• D
    shrink_dcache_sb speedup · 37c42524
    Denis V. Lunev 提交于
    This patch makes shrink_dcache_sb consistent with dentry pruning policy.
    
    On the first pass we iterate over dentry unused list and prepare some
    dentries for removal.
    
    However, since the existing code moves evicted dentries to the beginning of
    the LRU it can happen that fresh dentries from other superblocks will be
    inserted *before* our dentries.
    
    This can result in significant slowdown of shrink_dcache_sb().  Moreover,
    for virtual filesystems like unionfs which can call dput() during dentries
    kill existing code results in O(n^2) complexity.
    
    We observed 2 minutes shrink_dcache_sb() with only 35000 dentries.
    
    To avoid this effects we propose to isolate sb dentries at the end
    of LRU list.
    Signed-off-by: NDenis V. Lunev <den@openvz.org>
    Signed-off-by: NKirill Korotaev <dev@openvz.org>
    Signed-off-by: NAndrey Mirkin <amirkin@openvz.org>
    Cc: Neil Brown <neilb@suse.de>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    37c42524
dcache.c 55.4 KB