[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130913200000.GT13318@ZenIV.linux.org.uk>
Date: Fri, 13 Sep 2013 21:00:00 +0100
From: Al Viro <viro@...IV.linux.org.uk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
linux-next <linux-next@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Dave Chinner <dchinner@...hat.com>,
Glauber Costa <glommer@...nvz.org>
Subject: Re: linux-next: manual merge of the akpm tree with Linus' tree
On Fri, Sep 13, 2013 at 12:12:20PM -0700, Linus Torvalds wrote:
> It tries to consolidate the dentry LRU stuff into a few helper
> functions that right now have anal checking of the flags. Maybe I
> overdid it, but the code was really confusing, and I think we got the
> free dentry counts wrong, and the bits wrong too, so I tried to be
> extra careful.
>
> There are several cases:
> - d_lru_add/del: fairly obvious
> - d_lru_isolate: this is when the LRU callbacks ask us to remove the
> entry from the list. This is different from d_lru_del() only in that
> it uses the raw list removal, not the lru list helper function. I'm
> not sure that's right, but that's what the code used to do.
It is right - for one thing, we are holding the lock on that LRU list,
so list_lru_del() would deadlock right there. For another, the same
list_lru_walk (OK, list_lru_walk_node()) will do ->nr_items decrement
when we return LRU_REMOVED to it, so we don't want to do it twice.
Plain list_del_init() is correct here.
> - d_lru_shrink_move: move from the "global" lru list to a private shrinker list
> - d_shrink_add/del: fairly obvious.
>
> And then "denty_lru_add/del" that actually take the current state into
> account and do the right thing. Those we had before, I'm just
> explaining the difference from the low-level operations that have
> fixed "from this state to that" semantics
Looks sane; FWIW, the variant I'm playing with uses two independent
flags for "shrinker" and "per-sb", but AFAICS that doesn't yield better
code. Feel free to slap my acked-by on it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists