public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Question on build_sched_domains
@ 2006-03-24  2:58 Srivatsa Vaddagiri
  2006-03-24  7:12 ` Srivatsa Vaddagiri
  0 siblings, 1 reply; 6+ messages in thread
From: Srivatsa Vaddagiri @ 2006-03-24  2:58 UTC (permalink / raw)
  To: nickpiggin; +Cc: linux-kernel, Ingo Molnar

Nick,
	I was going thr' build_sched_domains and had a question
regarding formation of sched_groups for NUMA nodes. There are two 'for'
loops, each loop possibly allocating memory (sched_group) for one or more nodes.
My question is: in the outer loop, don't we need to skip allocating for
nodes for whom the inner loop has allocated in an earlier pass?

Taking the example of 4 node system which are in the same
sched_domain_node_span(), I see that we end up allocating 16
times (when 4 would have sufficed?).

What am I missing here? 

-- 
Regards,
vatsa

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

* Re: Question on build_sched_domains
  2006-03-24  2:58 Question on build_sched_domains Srivatsa Vaddagiri
@ 2006-03-24  7:12 ` Srivatsa Vaddagiri
  2006-03-24  7:45   ` Nick Piggin
  0 siblings, 1 reply; 6+ messages in thread
From: Srivatsa Vaddagiri @ 2006-03-24  7:12 UTC (permalink / raw)
  To: nickpiggin; +Cc: linux-kernel, Ingo Molnar

On Fri, Mar 24, 2006 at 08:28:34AM +0530, Srivatsa Vaddagiri wrote:
> Taking the example of 4 node system which are in the same
> sched_domain_node_span(), I see that we end up allocating 16
> times (when 4 would have sufficed?).

Maybe this is it to avoid touching same memory from different nodes?

-- 
Regards,
vatsa

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

* Re: Question on build_sched_domains
  2006-03-24  7:12 ` Srivatsa Vaddagiri
@ 2006-03-24  7:45   ` Nick Piggin
  2006-03-25  8:36     ` Srivatsa Vaddagiri
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Piggin @ 2006-03-24  7:45 UTC (permalink / raw)
  To: vatsa; +Cc: linux-kernel, Ingo Molnar

Srivatsa Vaddagiri wrote:
> On Fri, Mar 24, 2006 at 08:28:34AM +0530, Srivatsa Vaddagiri wrote:
> 
>>Taking the example of 4 node system which are in the same
>>sched_domain_node_span(), I see that we end up allocating 16
>>times (when 4 would have sufficed?).
> 
> 
> Maybe this is it to avoid touching same memory from different nodes?
> 

Yeah I think what's happening is that the sched groups structures
are not shared between nodes. (It's been a while since I looked at
this code, and it is a bit tricky to follow).

Aside, it should be using kmalloc_node now...

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

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

* Re: Question on build_sched_domains
  2006-03-24  7:45   ` Nick Piggin
@ 2006-03-25  8:36     ` Srivatsa Vaddagiri
  2006-03-26  2:21       ` Nick Piggin
  0 siblings, 1 reply; 6+ messages in thread
From: Srivatsa Vaddagiri @ 2006-03-25  8:36 UTC (permalink / raw)
  To: Nick Piggin; +Cc: linux-kernel, Ingo Molnar

On Fri, Mar 24, 2006 at 06:45:21PM +1100, Nick Piggin wrote:
> Yeah I think what's happening is that the sched groups structures
> are not shared between nodes. (It's been a while since I looked at
> this code, and it is a bit tricky to follow).

Its really odd that sched group structure aren't shared between nodes in some 
case (sched_group_nodes) and are shared in other cases (sched_group_cpus, 
sched_group_core, sched_group_phys).

Also is the GFP_ATOMIC allocation really required (for
sched_group_nodes) in build_sched_domains()?

-- 
Regards,
vatsa

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

* Re: Question on build_sched_domains
  2006-03-25  8:36     ` Srivatsa Vaddagiri
@ 2006-03-26  2:21       ` Nick Piggin
  2006-03-26  2:41         ` Srivatsa Vaddagiri
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Piggin @ 2006-03-26  2:21 UTC (permalink / raw)
  To: vatsa; +Cc: linux-kernel, Ingo Molnar

Srivatsa Vaddagiri wrote:
> On Fri, Mar 24, 2006 at 06:45:21PM +1100, Nick Piggin wrote:
> 
>>Yeah I think what's happening is that the sched groups structures
>>are not shared between nodes. (It's been a while since I looked at
>>this code, and it is a bit tricky to follow).
> 
> 
> Its really odd that sched group structure aren't shared between nodes in some 
> case (sched_group_nodes) and are shared in other cases (sched_group_cpus, 
> sched_group_core, sched_group_phys).
> 
> Also is the GFP_ATOMIC allocation really required (for
> sched_group_nodes) in build_sched_domains()?
> 

I don't see why. It should be changed to GFP_KERNEL.

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

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

* Re: Question on build_sched_domains
  2006-03-26  2:21       ` Nick Piggin
@ 2006-03-26  2:41         ` Srivatsa Vaddagiri
  0 siblings, 0 replies; 6+ messages in thread
From: Srivatsa Vaddagiri @ 2006-03-26  2:41 UTC (permalink / raw)
  To: Nick Piggin; +Cc: linux-kernel, Ingo Molnar

On Sun, Mar 26, 2006 at 12:21:36PM +1000, Nick Piggin wrote:
> I don't see why. It should be changed to GFP_KERNEL.

Thats what I thought too. Will submit a patch to that effect, while I am
cleaning up build_sched_domains.

-- 
Regards,
vatsa

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

end of thread, other threads:[~2006-03-26  2:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-24  2:58 Question on build_sched_domains Srivatsa Vaddagiri
2006-03-24  7:12 ` Srivatsa Vaddagiri
2006-03-24  7:45   ` Nick Piggin
2006-03-25  8:36     ` Srivatsa Vaddagiri
2006-03-26  2:21       ` Nick Piggin
2006-03-26  2:41         ` Srivatsa Vaddagiri

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