netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	netdev@vger.kernel.org, linux-nfs@vger.kernel.org,
	Trond Myklebust <trond@netapp.com>, Ingo Molnar <mingo@elte.hu>,
	Nick Piggin <npiggin@suse.de>
Subject: Re: nfs client lockdep warning
Date: Mon, 12 Jan 2009 13:02:11 +0100	[thread overview]
Message-ID: <1231761731.4371.7.camel@laptop> (raw)
In-Reply-To: <20090109202939.GA5466@fieldses.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 <a.p.zijlstra@chello.nl>
---
 mm/memory.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

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



  reply	other threads:[~2009-01-12 12:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090108203658.GE19312@fieldses.org>
     [not found] ` <1231447707.7179.10.camel@heimdal.trondhjem.org>
     [not found]   ` <1231447707.7179.10.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-01-08 21:20     ` nfs client lockdep warning J. Bruce Fields
     [not found]       ` <20090108212056.GF19312-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2009-01-09  4:33         ` Herbert Xu
2009-01-09  5:58           ` Peter Zijlstra
2009-01-09  6:23             ` Herbert Xu
2009-01-09  6:51               ` Peter Zijlstra
2009-01-09 20:29                 ` J. Bruce Fields
2009-01-12 12:02                   ` Peter Zijlstra [this message]
2009-01-12 12:10                     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1231761731.4371.7.camel@laptop \
    --to=a.p.zijlstra@chello.nl \
    --cc=bfields@fieldses.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=npiggin@suse.de \
    --cc=trond@netapp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).