linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
From: Paul Jackson <pj@sgi.com>
To: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, menage@google.com, Paul Jackson <pj@sgi.com>,
	clameter@sgi.com
Subject: [PATCH] mm: fallback_alloc cpuset_zone_allowed irq fix
Date: Wed, 06 Dec 2006 02:49:51 -0800	[thread overview]
Message-ID: <20061206104951.766.40407.sendpatchset@v0> (raw)

fallback_alloc() could end up calling cpuset_zone_allowed()
with interrupts disabled (by code in kmem_cache_alloc_node()),
but without __GFP_HARDWALL set, leading to a possible
call of a sleeping function with interrupts disabled.

This results in the BUG report:

  BUG: sleeping function called from invalid context at kernel/cpuset.c:1520
in_atomic():0, irqs_disabled():1

Thanks to Paul Menage for catching this one.

Signed-off-by: Paul Jackson <pj@sgi.com>

---
 mm/slab.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

--- 2.6.19-rc6-mm2.orig/mm/slab.c	2006-11-30 19:45:50.000000000 -0800
+++ 2.6.19-rc6-mm2/mm/slab.c	2006-12-05 22:41:49.000000000 -0800
@@ -3261,7 +3261,8 @@ void *fallback_alloc(struct kmem_cache *
 		int nid = zone_to_nid(*z);
 
 		if (zone_idx(*z) <= ZONE_NORMAL &&
-				cpuset_zone_allowed(*z, flags) &&
+				cpuset_zone_allowed(*z,
+					flags | __GFP_HARDWALL) &&
 				cache->nodelists[nid])
 			obj = ____cache_alloc_node(cache,
 					flags | __GFP_THISNODE, nid);

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

                 reply	other threads:[~2006-12-06 10:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20061206104951.766.40407.sendpatchset@v0 \
    --to=pj@sgi.com \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=menage@google.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