Re: [PATCH 3/5 v2] superblock: introduce per-sb cache shrinker infrastructure

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dave Chinner
Date: Wednesday, May 26, 2010 - 11:17 pm

On Thu, May 27, 2010 at 05:01:20AM +0100, Al Viro wrote:

I was worried about memory allocation in the ->kill_sb path
deadlocking on the s_umount lock if it enters reclaim. e.g.  XFS
inodes can still be dirty even after the VFS has disposed of them,
and writing them back can require page cache allocation for the
backing buffers. If allocation recurses back into the shrinker, we
can deadlock on the s_umount lock.  This doesn't seem like an XFS
specific problem, so I used a trylock to avoid that whole class of
problems (same way the current shrinkers do).

From there, we can unregister the shrinker before calling ->kill_sb
as per above. That, in turn, means that the unmount
invalidate_inodes() vs shrinker race goes away and the iprune_sem is
not needed in the new prune_icache_sb() function.  I'm pretty sure
that I can now remove the iprune_sem, but I haven't written the
patch to do that yet.

Cheers,

Dave.

-- 
Dave Chinner
david@fromorbit.com
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 3/5 v2] superblock: introduce per-sb cache shri ..., Dave Chinner, (Wed May 26, 11:17 pm)