lkml.org 
[lkml]   [2019]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 14/14] dcache: Implement object migration
On Wed, Apr 03, 2019 at 06:19:21PM +0100, Al Viro wrote:
> On Wed, Apr 03, 2019 at 06:08:11PM +0100, Al Viro wrote:
>
> > Oh, *brilliant*
> >
> > Let's do d_invalidate() on random dentries and hope they go away.
> > With convoluted and brittle logics for deciding which ones to
> > spare, which is actually wrong. This will pick mountpoints
> > and tear them out, to start with.
> >
> > NAKed-by: Al Viro <viro@zeniv.linux.org.uk>
> >
> > And this is a NAK for the entire approach; if it has a positive refcount,
> > LEAVE IT ALONE. Period. Don't play this kind of games, they are wrong.
> > d_invalidate() is not something that can be done to an arbitrary dentry.
>
> PS: "try to evict what can be evicted out of this set" can be done, but
> you want something like
> start with empty list
> go through your array of references
> grab dentry->d_lock
> if dentry->d_lockref.count is not zero
> unlock and continue
> if dentry->d_flags & DCACHE_SHRINK_LIST
> ditto, it's not for us to play with
> if (dentry->d_flags & DCACHE_LRU_LIST)
> d_lru_del(dentry);
> d_shrink_add(dentry, &list);
> unlock
>
> on the collection phase and
> if the list is not empty by the end of that loop
> shrink_dentry_list(&list);
> on the disposal.

Implemented as suggested, thanks. RFCv3 to come when we have some stats
for you :)

thanks,
Tobin.

\
 
 \ /
  Last update: 2019-04-04 23:19    [W:0.152 / U:37.196 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site