From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Takashi Nishiie" Subject: RE: [RFC] possible badness in prune_dcache() Date: Mon, 7 Apr 2008 15:40:53 +0900 Message-ID: <000501c8987a$539eb080$fadc1180$@css.fujitsu.com> References: <1207309200.12346.25.camel@bear.shadowland> <1207322926.12346.30.camel@bear.shadowland> <20080404152928.GD22429@unused.rdu.redhat.com> <20080404155729.GE22429@unused.rdu.redhat.com> <20080404184408.GG22429@unused.rdu.redhat.com> <20080404191343.GI22429@unused.rdu.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Return-path: Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:55954 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752002AbYDGGko (ORCPT ); Mon, 7 Apr 2008 02:40:44 -0400 Received: from m2.gw.fujitsu.co.jp ([10.0.50.72]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id m376eh7C015660 for (envelope-from t-nishiie@np.css.fujitsu.com); Mon, 7 Apr 2008 15:40:43 +0900 Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 0D81D1B801E for ; Mon, 7 Apr 2008 15:40:43 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (s6.gw.fujitsu.co.jp [10.0.50.96]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id A99152DC01D for ; Mon, 7 Apr 2008 15:40:42 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (s6 [127.0.0.1]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id 90097161C00C for ; Mon, 7 Apr 2008 15:40:42 +0900 (JST) Received: from ml1.s.css.fujitsu.com (ml1.s.css.fujitsu.com [10.23.4.191]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id 1FB6D161C00B for ; Mon, 7 Apr 2008 15:40:42 +0900 (JST) Received: from ml1.css.fujitsu.com (ml1 [127.0.0.1]) by ml1.s.css.fujitsu.com (Postfix) with ESMTP id F416D1034008 for ; Mon, 7 Apr 2008 15:40:41 +0900 (JST) Received: from agtnishiie (unknown [10.124.60.68]) by ml1.s.css.fujitsu.com (Postfix) with ESMTP id 6AC00103400D for ; Mon, 7 Apr 2008 15:40:41 +0900 (JST) In-Reply-To: <20080404191343.GI22429@unused.rdu.redhat.com> Content-Language: ja Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Apr 04, 2008 at 09:01:26PM +0200, Miklos Szeredi wrote: > > > > > probably worth looking at doing something different in the case of > > > > > shrinking the dcache on the parent, and leaving prune_dcache to > > > > > only be called in the case of trying to free up dcache under > > > > > memory pressure, where the superblock doesn't actually matter. > > > > > For the RHEL3 issue you are reffering to I fixed it by creating a > > > > > private list when we shrunk the parent, and submitting that list > > > > > to prune_dcache that way we didn't spend all this time looping. I > > > > > will see what can be done for upstream. > > > > > > Which sounds racy with umount. A hashed dentry must either have a > > > refcount greater than one, or be on dentry_unused list. This patch > > > breaks that assumption. > > > > > > > It should be racy with umount, if we notice that we're being > > unmounted we just break, as the unmount will free the dentry's > > itself through another means. > > But unmount could have already finished by then. And now you are > dereferencing a super block, that no longer exists. Not good. > > This separate list thing can't work, unfortunately. On the other hand > we should probably split prune_dcache() into two separate functions: > the garbage collector one (with sb == NULL argument) and the sb > specific shrinker. It should I think be possible to share the second > one with shrink_dcache_sb(). > Hi. As another reply, there is a patch David Chinner you list below. Per-superblock unused dentry LRU http://lwn.net/Articles/185465/ There is an article below as the recent argument which it is related. http://lkml.org/lkml/2008/3/5/590 I think that the idea of per superblock unusued LRUs is rational. Thanks