]> 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>
Fri, 2 Dec 2011 03:12:04 +0000 (14:12 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 2 Dec 2011 03:15:34 +0000 (14:15 +1100)
commit9e172bff4613ace17e3e399987bdd257f87700a6
tree800928e58f8487bde02c8330c0a7e60121c3a70c
parente0ab68cc022706c57f6c8d36671e89f7fd5615dc
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