[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1231761731.4371.7.camel@laptop>
Date: Mon, 12 Jan 2009 13:02:11 +0100
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: "J. Bruce Fields" <bfields@...ldses.org>
Cc: Herbert Xu <herbert@...dor.apana.org.au>, netdev@...r.kernel.org,
linux-nfs@...r.kernel.org, Trond Myklebust <trond@...app.com>,
Ingo Molnar <mingo@...e.hu>, Nick Piggin <npiggin@...e.de>
Subject: Re: nfs client lockdep warning
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@...llo.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists