From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756799Ab2AJVwq (ORCPT ); Tue, 10 Jan 2012 16:52:46 -0500 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 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtkKAAiwDE95LbVq/2dsb2JhbABCq1KBB4EGgXIBAQUyASMjEAgDGC4UJQMhE75pE4sdYwSVC4kfiTA Date: Wed, 11 Jan 2012 08:52:40 +1100 From: Dave Chinner To: Miklos Szeredi 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 Subject: Re: [RFC PATCH] shrink_dcache_parent() deadlock 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.  It does eliminate one trylock, but > >> that's not the one critical to this bug (removing it is a very good > >> 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. > > See the one with the subject "vfs: fix shrink_dcache_parent() > livelock" I sent out a bit earlier. > > You didn't quite get it right: the flag now needs to be set in > select_parent() not prune_dcache_sb(). > > 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. -- Dave Chinner david@fromorbit.com