From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Chinner Subject: Re: [RFC PATCH] shrink_dcache_parent() deadlock Date: Wed, 11 Jan 2012 08:52:40 +1100 Message-ID: <20120110215240.GA24410@dastard> References: <20120109171639.GA9359@infradead.org> <20120109173010.GX23916@ZenIV.linux.org.uk> <20120109205907.GE4198@dastard> <20120110013434.GA23916@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Linus Torvalds , Al Viro , Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, mgorman@suse.de, gregkh@suse.de, akpm@linux-foundation.org To: Miklos Szeredi Return-path: Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:24306 "EHLO ipmail06.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752202Ab2AJVwp (ORCPT ); Tue, 10 Jan 2012 16:52:45 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Jan 10, 2012 at 05:22:22PM +0100, Miklos Szeredi wrote: > On Tue, Jan 10, 2012 at 5:00 PM, Linus Torvalds > wrote: > > On Tue, Jan 10, 2012 at 2:05 AM, Miklos Szeredi = wrote: > >> > >> I tested Dave's patch and the bug can still be easily reproduced. > >> > >> And that's to be expected, as the intermediate "being on the lru" > >> state that Dave's patch eliminates doesn't play a fundamental part= in > >> the mechanism of the livelock. =A0It does eliminate one trylock, b= ut > >> that's not the one critical to this bug (removing it is a very goo= d > >> idea anyway). > >> > >> The critical trylock here is the one in dentry_kill() which tries = to > >> lock the parent. > > > > Ok. Here's your patch munged for current -git. You've got most of a > > changelog, can you send this out with the right subject and a > > sign-off, and re-test with the current git just to make sure. >=20 > See the one with the subject "vfs: fix shrink_dcache_parent() > livelock" I sent out a bit earlier. >=20 > You didn't quite get it right: the flag now needs to be set in > select_parent() not prune_dcache_sb(). >=20 > I think prune_dcache_sb() doesn't need this logic (although it > wouldn't hurt either) because that one is called from the slab > shrinkers and those are protected from being run multiple times in > parallel, I hope. Shrinkers can be called in parallel by memory reclaim on different CPUs. The only thing serialising them is the LRU locks. Cheers, Dave. --=20 Dave Chinner david@fromorbit.com -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html