Re: [patch 0/5] [PATCH,RFC] vfs: per-superblock unused dentries list (2nd version)
From: David Chinner
Date: Sun Jun 18 2006 - 19:56:35 EST
On Sat, Jun 17, 2006 at 08:25:14AM +1000, Neil Brown wrote:
> On Friday June 16, jblunck@xxxxxxx wrote:
> > On Mon, Jun 05, Neil Brown wrote:
> >
> > > I understand that this is where problem is because the selected
> > > dentries don't stay at the end of the list very long in some
> > > circumstances. In particular, other filesystems' dentries get mixed
> > > in.
> >
> > No. The problem is that the LRU list is too long and therefore unmounting
> > seems to take ages.
> >
>
> But I cannot see that the whole LRU list needs to be scanned during
> unmount.
...
> I can see that shrink_dcache_sb could take a long time and should be
> fixed, which should be as simple as replacing it with
> shrink_dcache_parent; shrink_dcache_anon.
But these are not guaranteed to reclaim all the dentries from a given
superblock. Yes, they move the dentries to the LRU, but other activity in the
system means that they may not get reclaimed during the subsequent calls
to prune_dcache() and hence they may live beyond the unmount....
> But I'm still puzzled as to why a long dcache LRU slows down
> unmounting.
>
> Can you give more details?
It's not the unmount that slows down - it's the fact that the dcache lock
is held for so long that rest of the system halts for time it takes
to run shrink_dcache_sb(). We've seen up to 50s to do a (touch fred; rm fred)
when the LRU has grown to several million dentries and shrink_dcache_sb()
is running. When this happens, it's not uncommon to see every CPU in the
machine spinning on the dcache_lock...
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/