lkml.org 
[lkml]   [2010]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/19] fs: Implement lazy LRU updates for inodes.
On Sat, Oct 16, 2010 at 08:47:10PM -0400, Christoph Hellwig wrote:
> On Sun, Oct 17, 2010 at 04:29:24AM +1100, Nick Piggin wrote:
> > > I don't think the pointer check will work either. By the time we retake
> > > the lru lock the inode might already have been reaped through a call
> > > to invalidate_inodes. There's no way we can do anything with it after
> >
> > I don't think you're right. If we re take inode_lock, ensure it is on
> > the LRU, and call the can_unuse checks, there is no more problem than
> > the regular loop taking items from the LRU, AFAIKS.
>
> As long as we have the global inode lock it should indeed be safe.
> But once we have a separate lru lock (global or per-zone, with or
> without i_lock during the addition) there is nothing preventing the
> inode from getting reused and re-added to the lru in the meantime.
> Sure this is an extremly unlikely case, but there is no locking to
> prevent it once inode_lock is gone.

No. There is nothing preventing that exact reuse from happening in
mainline _today_ either, because the inode_lock is dropped there too.

The point is that it is a heuristic that works (apparently) most of the
time but if it gets it wrong then it's not a big deal, it's only the LRU
position anyway. It would work exactly the same with separate global or
per-zone lru locks.



\
 
 \ /
  Last update: 2010-10-17 04:13    [W:0.077 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site