]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm, debug: test for online nid when allocating on single node
authorDavid Rientjes <rientjes@google.com>
Thu, 8 Dec 2011 04:41:47 +0000 (15:41 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 12 Dec 2011 04:18:57 +0000 (15:18 +1100)
commit3fde38cf40c959425323004855a668cc371d0a62
tree31246a324b5222673c3de906a222e71160c5027b
parentd2afa78debe9ba62d514fce64e800121915c21ba
mm, debug: test for online nid when allocating on single node

Calling alloc_pages_exact_node() means the allocation only passes the
zonelist of a single node into the page allocator.  If that node isn't
online, it's zonelist may never have been initialized causing a strange
oops that may not immediately be clear.

I recently debugged an issue where node 0 wasn't online and an allocator
was passing 0 to alloc_pages_exact_node() and it resulted in a NULL
pointer on zonelist->_zoneref.  If CONFIG_DEBUG_VM is enabled, though, it
would be nice to catch this a bit earlier.

Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/gfp.h