From: Borislav Petkov <bp@alien8.de>
To: David Rientjes <rientjes@google.com>, Rus <rus@sfinxsoft.com>
Cc: Ben Hutchings <ben@decadent.org.uk>,
Steven Rostedt <rostedt@goodmis.org>,
Christoph Lameter <cl@linux.com>,
LKML <linux-kernel@vger.kernel.org>,
stable <stable@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [WARNING] lockdep and kmemcheck_alloc_shadow
Date: Mon, 11 Jun 2012 13:04:00 +0200 [thread overview]
Message-ID: <20120611110359.GA17022@x1.osrc.amd.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1206110255380.12414@chino.kir.corp.google.com>
[-- Attachment #1: Type: text/plain, Size: 624 bytes --]
On Mon, Jun 11, 2012 at 02:56:03AM -0700, David Rientjes wrote:
> On Sun, 20 May 2012, David Rientjes wrote:
>
> > Agreed, slab handles this correctly and it looks like slub ends up
> > disabling irqs too early.
> >
> > Does this fix it? If so, we'll need to annotate it for stable as Ben
> > noted.
> >
>
> Steven, did you have a chance to see if this fixes the issue for you? Can
> I add your Tested-by?
Hehe,
this got triggered through a different path too:
http://marc.info/?l=linux-kernel&m=133909780907766
@Rus: Can you pls test David's patch? I'm re-attaching it here.
Thanks.
--
Regards/Gruss,
Boris.
[-- Attachment #2: mm-slub-irq-disable-fix.diff --]
[-- Type: text/x-diff, Size: 1224 bytes --]
From: David Rientjes <rientjes@google.com>
mm, slub: ensure irqs are not disabled for kmemcheck allocation
kmemcheck_alloc_shadow() cannot be called with irqs disabled, which is
possible with __GFP_WAIT. Ensure we always have them enabled at
allocation time like slab does.
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David Rientjes <rientjes@google.com>
---
diff --git a/mm/slub.c b/mm/slub.c
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1314,13 +1314,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
stat(s, ORDER_FALLBACK);
}
- if (flags & __GFP_WAIT)
- local_irq_disable();
-
- if (!page)
- return NULL;
-
- if (kmemcheck_enabled
+ if (page && kmemcheck_enabled
&& !(s->flags & (SLAB_NOTRACK | DEBUG_DEFAULT_FLAGS))) {
int pages = 1 << oo_order(oo);
@@ -1336,6 +1330,11 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
kmemcheck_mark_unallocated_pages(page, pages);
}
+ if (flags & __GFP_WAIT)
+ local_irq_disable();
+ if (!page)
+ return NULL;
+
page->objects = oo_objects(oo);
mod_zone_page_state(page_zone(page),
(s->flags & SLAB_RECLAIM_ACCOUNT) ?
prev parent reply other threads:[~2012-06-11 11:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-19 17:47 [WARNING] lockdep and kmemcheck_alloc_shadow Steven Rostedt
2012-05-20 3:52 ` Ben Hutchings
2012-05-20 21:10 ` David Rientjes
2012-06-11 9:56 ` David Rientjes
2012-06-11 11:04 ` Borislav Petkov [this message]
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=20120611110359.GA17022@x1.osrc.amd.com \
--to=bp@alien8.de \
--cc=ben@decadent.org.uk \
--cc=cl@linux.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rientjes@google.com \
--cc=rostedt@goodmis.org \
--cc=rus@sfinxsoft.com \
--cc=stable@vger.kernel.org \
/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).