]> 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>
Tue, 13 Dec 2011 06:43:12 +0000 (17:43 +1100)
commitfcdfc7d1b6685aedca81285c2a1bfa18f3f654f2
tree7b6300dd59544fd6b9dbf25970fb220b9c5269d3
parent8d6ac8da2f42300ee9bd947455af268f6161c0a8
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