]> 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>
Wed, 14 Dec 2011 05:48:06 +0000 (16:48 +1100)
commite581fb57f48b38ed1299b3a52ea481463f417c20
tree6fd0374a154111b8fbaf33fe2de98adba7369cc3
parent7b9d5c697266c373b0f4b4a0b7e3cafb3d90c901
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