提交 fbd98167 编写于 作者: C Christoph Lameter 提交者: Linus Torvalds

[PATCH] Profiling: require buffer allocation on the correct node

Profiling really suffers with off node buffers.  Fail if no memory is
available on the nodes.  The profiling code can deal with these failures
should they occur.
Signed-off-by: NChristoph Lameter <clameter@sgi.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1192d526
...@@ -309,13 +309,17 @@ static int __devinit profile_cpu_callback(struct notifier_block *info, ...@@ -309,13 +309,17 @@ static int __devinit profile_cpu_callback(struct notifier_block *info,
node = cpu_to_node(cpu); node = cpu_to_node(cpu);
per_cpu(cpu_profile_flip, cpu) = 0; per_cpu(cpu_profile_flip, cpu) = 0;
if (!per_cpu(cpu_profile_hits, cpu)[1]) { if (!per_cpu(cpu_profile_hits, cpu)[1]) {
page = alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0); page = alloc_pages_node(node,
GFP_KERNEL | __GFP_ZERO | GFP_THISNODE,
0);
if (!page) if (!page)
return NOTIFY_BAD; return NOTIFY_BAD;
per_cpu(cpu_profile_hits, cpu)[1] = page_address(page); per_cpu(cpu_profile_hits, cpu)[1] = page_address(page);
} }
if (!per_cpu(cpu_profile_hits, cpu)[0]) { if (!per_cpu(cpu_profile_hits, cpu)[0]) {
page = alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0); page = alloc_pages_node(node,
GFP_KERNEL | __GFP_ZERO | GFP_THISNODE,
0);
if (!page) if (!page)
goto out_free; goto out_free;
per_cpu(cpu_profile_hits, cpu)[0] = page_address(page); per_cpu(cpu_profile_hits, cpu)[0] = page_address(page);
...@@ -491,12 +495,16 @@ static int __init create_hash_tables(void) ...@@ -491,12 +495,16 @@ static int __init create_hash_tables(void)
int node = cpu_to_node(cpu); int node = cpu_to_node(cpu);
struct page *page; struct page *page;
page = alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0); page = alloc_pages_node(node,
GFP_KERNEL | __GFP_ZERO | GFP_THISNODE,
0);
if (!page) if (!page)
goto out_cleanup; goto out_cleanup;
per_cpu(cpu_profile_hits, cpu)[1] per_cpu(cpu_profile_hits, cpu)[1]
= (struct profile_hit *)page_address(page); = (struct profile_hit *)page_address(page);
page = alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0); page = alloc_pages_node(node,
GFP_KERNEL | __GFP_ZERO | GFP_THISNODE,
0);
if (!page) if (!page)
goto out_cleanup; goto out_cleanup;
per_cpu(cpu_profile_hits, cpu)[0] per_cpu(cpu_profile_hits, cpu)[0]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册