[PATCH] slab: fix kmalloc_node applying memory policies if nodeid == numa_node_id()
commitde3083ec3e6bfb1ab60bc8a410f37702529f953c
authorChristoph Lameter <clameter@sgi.com>
Wed, 27 Sep 2006 08:50:03 +0000 (27 01:50 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 27 Sep 2006 15:26:12 +0000 (27 08:26 -0700)
tree4093fcf3991e9af4be57c7c942dbea42011e4eb7
parent0fd0e6b05aa096622f151cac2f81f2e6844fb1bb
[PATCH] slab: fix kmalloc_node applying memory policies if nodeid == numa_node_id()

kmalloc_node() falls back to ___cache_alloc() under certain conditions and
at that point memory policies may be applied redirecting the allocation
away from the current node.  Therefore kmalloc_node(...,numa_node_id()) or
kmalloc_node(...,-1) may not return memory from the local node.

Fix this by doing the policy check in __cache_alloc() instead of
____cache_alloc().

This version here is a cleanup of Kiran's patch.

- Tested on ia64.
- Extra material removed.
- Consolidate the exit path if alternate_node_alloc() returned an object.

[akpm@osdl.org: warning fix]
Signed-off-by: Alok N Kataria <alok.kataria@calsoftinc.com>
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/slab.c