diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-10-16 04:25:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:42:59 -0400 |
commit | 523b945855a1427000ffc707c610abe5947ae607 (patch) | |
tree | 2d84b5b6822a2a20bfd79146c08ce06ac8c80b9b /include/linux/mmzone.h | |
parent | 633c0666b5a5c41c376a5a7e4304d638dc48c1b9 (diff) |
Memoryless nodes: Fix GFP_THISNODE behavior
GFP_THISNODE checks that the zone selected is within the pgdat (node) of the
first zone of a nodelist. That only works if the node has memory. A
memoryless node will have its first node on another pgdat (node).
GFP_THISNODE currently will return simply memory on the first pgdat. Thus it
is returning memory on other nodes. GFP_THISNODE should fail if there is no
local memory on a node.
Add a new set of zonelists for each node that only contain the nodes that
belong to the zones itself so that no fallback is possible.
Then modify gfp_type to pickup the right zone based on the presence of
__GFP_THISNODE.
Drop the existing GFP_THISNODE checks from the page_allocators hot path.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Nishanth Aravamudan <nacc@us.ibm.com>
Tested-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Acked-by: Bob Picco <bob.picco@hp.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Mel Gorman <mel@skynet.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r-- | include/linux/mmzone.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index f21e5951038b..f6167f2fd7fb 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -324,6 +324,17 @@ struct zone { | |||
324 | #define MAX_ZONES_PER_ZONELIST (MAX_NUMNODES * MAX_NR_ZONES) | 324 | #define MAX_ZONES_PER_ZONELIST (MAX_NUMNODES * MAX_NR_ZONES) |
325 | 325 | ||
326 | #ifdef CONFIG_NUMA | 326 | #ifdef CONFIG_NUMA |
327 | |||
328 | /* | ||
329 | * The NUMA zonelists are doubled becausse we need zonelists that restrict the | ||
330 | * allocations to a single node for GFP_THISNODE. | ||
331 | * | ||
332 | * [0 .. MAX_NR_ZONES -1] : Zonelists with fallback | ||
333 | * [MAZ_NR_ZONES ... MAZ_ZONELISTS -1] : No fallback (GFP_THISNODE) | ||
334 | */ | ||
335 | #define MAX_ZONELISTS (2 * MAX_NR_ZONES) | ||
336 | |||
337 | |||
327 | /* | 338 | /* |
328 | * We cache key information from each zonelist for smaller cache | 339 | * We cache key information from each zonelist for smaller cache |
329 | * footprint when scanning for free pages in get_page_from_freelist(). | 340 | * footprint when scanning for free pages in get_page_from_freelist(). |
@@ -389,6 +400,7 @@ struct zonelist_cache { | |||
389 | unsigned long last_full_zap; /* when last zap'd (jiffies) */ | 400 | unsigned long last_full_zap; /* when last zap'd (jiffies) */ |
390 | }; | 401 | }; |
391 | #else | 402 | #else |
403 | #define MAX_ZONELISTS MAX_NR_ZONES | ||
392 | struct zonelist_cache; | 404 | struct zonelist_cache; |
393 | #endif | 405 | #endif |
394 | 406 | ||
@@ -455,7 +467,7 @@ extern struct page *mem_map; | |||
455 | struct bootmem_data; | 467 | struct bootmem_data; |
456 | typedef struct pglist_data { | 468 | typedef struct pglist_data { |
457 | struct zone node_zones[MAX_NR_ZONES]; | 469 | struct zone node_zones[MAX_NR_ZONES]; |
458 | struct zonelist node_zonelists[MAX_NR_ZONES]; | 470 | struct zonelist node_zonelists[MAX_ZONELISTS]; |
459 | int nr_zones; | 471 | int nr_zones; |
460 | #ifdef CONFIG_FLAT_NODE_MEM_MAP | 472 | #ifdef CONFIG_FLAT_NODE_MEM_MAP |
461 | struct page *node_mem_map; | 473 | struct page *node_mem_map; |