]> 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>
Fri, 9 Dec 2011 04:52:36 +0000 (15:52 +1100)
commitc6a3024e2391597a1f4276362614dfdb9102f23a
tree06be3f4ed902fb5b01cddfd69d94ab448d03e357
parente642cd53bb9fef012f8783bf32d2d7f756e1e48f
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