From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH] make inotify event handles use GFP_NOFS Date: Fri, 03 Apr 2009 16:34:00 +0200 Message-ID: <1238769240.798.110.camel@twins> References: <1237400852.26799.16.camel@localhost.localdomain> <20090330142610.4b94935d.akpm@linux-foundation.org> <1238448816.4073.265.camel@laptop> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Eric Paris , linux-kernel@vger.kernel.org, mingo@elte.hu, balbir@linux.vnet.ibm.com, linux-fsdevel@vger.kernel.org, aviro@redhat.com To: Andrew Morton Return-path: Received: from casper.infradead.org ([85.118.1.10]:45700 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932143AbZDCOd1 (ORCPT ); Fri, 3 Apr 2009 10:33:27 -0400 In-Reply-To: <1238448816.4073.265.camel@laptop> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, 2009-03-30 at 23:33 +0200, Peter Zijlstra wrote: > On Mon, 2009-03-30 at 14:26 -0700, Andrew Morton wrote: > > On Wed, 18 Mar 2009 14:27:32 -0400 > > Eric Paris wrote: > > > > > I think this is a bandaide to shut up lockdep. I could either figure > > > out lockdep classes and figure out how to reclassify inotify locks since > > > I believe Nick is correct when he says inotify watches pin the inode in > > > core so memory pressure can't evict it. > > > > It's pretty sad to degrading the strength of the memory allocation just > > to squish a lockdep report. > > Yeah, I agree, its the wrong thing to do. lockdep annotations really > aren't that hard -- also, you could also talk me through it. static struct lock_class_key inotify_mutex_free; /* * here the inotify mutex gets moved to a different * data structure with different locking semantics while * holding inotify_mutex. */ lock_set_class(&foo->inotify_mutex.dep_map, "inotify_mutex_free", &inotify_mutex_free, 0, _THIS_IP_); Or when done without holding the inotify_mutex /* * here the inotify mutex gets moved to a different * data structure with different locking semantics. */ lockdep_set_class(&foo->inotify_mutex, &inotify_mutex_free); Is all there should be to it.