From: Hugh Dickins <hugh@veritas.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <clameter@sgi.com>, linux-kernel@vger.kernel.org
Subject: [PATCH -mm] slub: update cpu after new_slab()
Date: Wed, 25 Apr 2007 16:21:00 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0704251613280.19217@blonde.wat.veritas.com> (raw)
SLUB gave me a NULL pointer dereference in slab_alloc(), in the
slab_lock(page) of its "Current cpuslab is acceptable" block: cpu
1 had been looking at cpu_slab[2], which then went NULL beneath it.
Since new_slab() may reenable interrupts and sleep (when __GFP_WAIT),
we may get rescheduled on a different cpu: so need to reevaluate it.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
--- 2.6.21-rc7-mm1/mm/slub.c 2007-04-24 20:26:48.000000000 +0100
+++ linux/mm/slub.c 2007-04-25 15:49:12.000000000 +0100
@@ -1234,11 +1234,12 @@ have_slab:
page = new_slab(s, gfpflags, node);
if (page) {
+ cpu = smp_processor_id();
if (s->cpu_slab[cpu]) {
/*
- * Someone else populated the cpu_slab while
- * we enabled interrupts. The page may not
- * be on the requested node.
+ * Someone else populated the cpu_slab while we enabled
+ * interrupts, or we have got scheduled on another cpu.
+ * The page may not be on the requested node.
*/
if (node == -1 ||
page_to_nid(s->cpu_slab[cpu]) == node) {
next reply other threads:[~2007-04-25 15:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 15:21 Hugh Dickins [this message]
2007-04-25 15:29 ` Christoph Lameter
2007-04-25 15:49 ` Hugh Dickins
2007-04-25 15:58 ` Christoph Lameter
2007-04-25 16:13 ` Hugh Dickins
2007-04-25 16:21 ` Christoph Lameter
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=Pine.LNX.4.64.0704251613280.19217@blonde.wat.veritas.com \
--to=hugh@veritas.com \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®