linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Profiling: Require buffer allocation on the correct node
@ 2006-08-10  2:18 Christoph Lameter
  2006-08-10  3:21 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Lameter @ 2006-08-10  2:18 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm

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: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.18-rc3-mm2/kernel/profile.c
===================================================================
--- linux-2.6.18-rc3-mm2.orig/kernel/profile.c	2006-07-29 23:15:36.000000000 -0700
+++ linux-2.6.18-rc3-mm2/kernel/profile.c	2006-08-09 19:17:18.274748071 -0700
@@ -309,13 +309,17 @@ static int __devinit profile_cpu_callbac
 		node = cpu_to_node(cpu);
 		per_cpu(cpu_profile_flip, cpu) = 0;
 		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)
 				return NOTIFY_BAD;
 			per_cpu(cpu_profile_hits, cpu)[1] = page_address(page);
 		}
 		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)
 				goto out_free;
 			per_cpu(cpu_profile_hits, cpu)[0] = page_address(page);
@@ -491,12 +495,16 @@ static int __init create_hash_tables(voi
 		int node = cpu_to_node(cpu);
 		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)
 			goto out_cleanup;
 		per_cpu(cpu_profile_hits, cpu)[1]
 				= (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)
 			goto out_cleanup;
 		per_cpu(cpu_profile_hits, cpu)[0]

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Profiling: Require buffer allocation on the correct node
  2006-08-10  2:18 Profiling: Require buffer allocation on the correct node Christoph Lameter
@ 2006-08-10  3:21 ` Andi Kleen
  2006-08-10  4:53   ` Christoph Lameter
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2006-08-10  3:21 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: akpm, linux-mm

On Thursday 10 August 2006 04:18, Christoph Lameter wrote:
> 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.

At least for Opterons and other small NUMAs I have my doubts this is a good strategy.
However it probably shouldn't happen very often, but if it happened it would be 
the wrong thing.

In general shouldn't there be a printk at least? Doing such things silently is a bit
nasty.

-Andi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Profiling: Require buffer allocation on the correct node
  2006-08-10  3:21 ` Andi Kleen
@ 2006-08-10  4:53   ` Christoph Lameter
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Lameter @ 2006-08-10  4:53 UTC (permalink / raw)
  To: Andi Kleen; +Cc: akpm, linux-mm

On Thu, 10 Aug 2006, Andi Kleen wrote:

> On Thursday 10 August 2006 04:18, Christoph Lameter wrote:
> > 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.
> 
> At least for Opterons and other small NUMAs I have my doubts this is a good strategy.
> However it probably shouldn't happen very often, but if it happened it would be 
> the wrong thing.
> 
> In general shouldn't there be a printk at least? Doing such things silently is a bit
> nasty.

The code already checks for failing allocations and it gives a messages 
AFAIK. This is just a fix so that the allocator does what they thought it 
would be doing.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-10  4:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-10  2:18 Profiling: Require buffer allocation on the correct node Christoph Lameter
2006-08-10  3:21 ` Andi Kleen
2006-08-10  4:53   ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox