From patchwork Mon Jan 12 12:02:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 17919 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id DD0A8DE09E for ; Mon, 12 Jan 2009 23:02:37 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752218AbZALMCd (ORCPT ); Mon, 12 Jan 2009 07:02:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752182AbZALMCd (ORCPT ); Mon, 12 Jan 2009 07:02:33 -0500 Received: from casper.infradead.org ([85.118.1.10]:52983 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752143AbZALMCc (ORCPT ); Mon, 12 Jan 2009 07:02:32 -0500 Received: from d9244.upc-d.chello.nl ([213.46.9.244] helo=dyad.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1LMLUi-0000Ey-9g; Mon, 12 Jan 2009 12:02:12 +0000 Received: from [192.168.0.240] (unknown [192.168.0.240]) by dyad.programming.kicks-ass.net (Postfix) with ESMTP id BCC1B39364; Mon, 12 Jan 2009 13:01:31 +0100 (CET) Subject: Re: nfs client lockdep warning From: Peter Zijlstra To: "J. Bruce Fields" Cc: Herbert Xu , netdev@vger.kernel.org, linux-nfs@vger.kernel.org, Trond Myklebust , Ingo Molnar , Nick Piggin In-Reply-To: <20090109202939.GA5466@fieldses.org> References: <20090108203658.GE19312@fieldses.org> <1231447707.7179.10.camel@heimdal.trondhjem.org> <20090108212056.GF19312@fieldses.org> <20090109043315.GA12139@gondor.apana.org.au> <1231480697.11687.522.camel@twins> <20090109062333.GB13304@gondor.apana.org.au> <1231483868.11687.523.camel@twins> <20090109202939.GA5466@fieldses.org> Date: Mon, 12 Jan 2009 13:02:11 +0100 Message-Id: <1231761731.4371.7.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 2009-01-09 at 15:29 -0500, J. Bruce Fields wrote: > > > > Is there anything pinning that user-space page, if not its free to > > > > fault, which would mean its a real warning... > > > > > > It's kernel memory, not user memory. See xs_udp_send_request in > > > net/sunrpc. > > --- > > diff --git a/mm/memory.c b/mm/memory.c > > index 7b9db65..a2ed52e 100644 > > --- a/mm/memory.c > > +++ b/mm/memory.c > > @@ -3079,6 +3079,9 @@ void print_vma_addr(char *prefix, unsigned long ip) > > #ifdef CONFIG_PROVE_LOCKING > > void might_fault(void) > > { > > + if (get_fs() == KERNEL_DS) > > Looks like that should be > > if ((segment_eq(get_fs(), KERNEL_DS)) > > ? Anyway, with that, sure, that eliminates the lockdep warning. Right, thanks! --- Subject: lockdep,mm: fix might_fault() annotation Some code (nfs/sunrpc) uses socket ops on kernel memory while holding the mmap_sem, this is safe because kernel memory doesn't get paged out, therefore we'll never actually fault, and the might_fault() annotations will generate false positives. Signed-off-by: Peter Zijlstra --- mm/memory.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/mm/memory.c b/mm/memory.c index e009ce8..c2d4c47 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3165,6 +3165,15 @@ void print_vma_addr(char *prefix, unsigned long ip) #ifdef CONFIG_PROVE_LOCKING void might_fault(void) { + /* + * Some code (nfs/sunrpc) uses socket ops on kernel memory while + * holding the mmap_sem, this is safe because kernel memory doesn't + * get paged out, therefore we'll never actually fault, and the + * below annotations will generate false positives. + */ + if (segment_eq(get_fs(), KERNEL_DS)) + return; + might_sleep(); /* * it would be nicer only to annotate paths which are not under