lkml.org 
[lkml]   [2014]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: dcache shrink list corruption?
From
On Wed, Apr 30, 2014 at 8:36 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Wed, Apr 30, 2014 at 07:33:38PM +0200, Miklos Szeredi wrote:
>> On Wed, Apr 30, 2014 at 6:03 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>> > On Wed, Apr 30, 2014 at 05:49:58PM +0200, Miklos Szeredi wrote:
>> >> > FWIW, the first two are really straightforward expanding the function
>> >> > into its only callsite. The last needs more splitup. Not sure if the
>> >> > following is good enough, but it ought to be at least somewhat cleaner.
>> >> > Combined change is identical to the original, so it doesn't invalidate
>> >> > the testing so far...
>> >>
>> >> Hmm, patches look okay, but I'm wondering if we really need the morgue list and
>> >> the waiting. Why not just skip dentries that are presently being handled by
>> >> dentry_kill()?
>> >
>> > Who will be freeing them? If we do that from dentry_kill(), we are back to
>> > needing them removed from shrink list by something called by dput(). And
>> > if we do that from shrink_dentry_list(), we'd damn better wait for
>> > dentry_iput() et.al. to finish.
>>
>> We can do it from dput if the shrinker gets there first and from the
>> shrinker if dput manages to finish before. See the updated patch in
>> the previous mail.
>
> Er? The only patch I see is removal of RCU from shrink_dentry_list(), which
> is fine, but doesn't do anything of that sort. What was the Message-ID?

Message-ID: <20140430154958.GC3113@tucsk.piliscsaba.szeredi.hu>

>
> Let me see if I understand what you are proposing:
> dentry_kill(dentry, 0) seeing DCACHE_DENTRY_KILLED
> check DCACHE_MAY_FREE, free it's been set
> dentry_kill(dentry, 1) seeing that we are on shrinker list
> leave on the list, do the work on killing, retake ->d_lock,
> if we are still on shrinker list
> set DCACHE_MAY_FREE,
> else
> free it
>
> That would probably work...

Exactly.

Thanks,
Miklos


\
 
 \ /
  Last update: 2014-04-30 21:21    [W:0.697 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site