Re: [patch 2/5] sched: NULL domains

2005-04-06 Thread Nick Piggin
Ingo Molnar wrote:
* Ingo Molnar <[EMAIL PROTECTED]> wrote:

* Nick Piggin <[EMAIL PROTECTED]> wrote:

2/5

The previous patch fixed the last 2 places that directly access a
runqueue's sched-domain and assume it cannot be NULL.
We can now use a NULL domain instead of a dummy domain to signify
no balancing is to happen. No functional changes.
Signed-off-by: Nick Piggin <[EMAIL PROTECTED]>
Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
  ^^^
Thanks.

if the previous 'remove degenerate domains' patch would go away then 
this patch needs to be merged/modified. (and most of the others as well)

I probably should respin this so it goes in *first* anyway.
Rather than doing half in the remove degenerate domains and
half here.
--
SUSE Labs, Novell Inc.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 2/5] sched: NULL domains

2005-04-06 Thread Nick Piggin
Ingo Molnar wrote:
* Ingo Molnar [EMAIL PROTECTED] wrote:

* Nick Piggin [EMAIL PROTECTED] wrote:

2/5

The previous patch fixed the last 2 places that directly access a
runqueue's sched-domain and assume it cannot be NULL.
We can now use a NULL domain instead of a dummy domain to signify
no balancing is to happen. No functional changes.
Signed-off-by: Nick Piggin [EMAIL PROTECTED]
Acked-by: Ingo Molnar [EMAIL PROTECTED]
  ^^^
Thanks.

if the previous 'remove degenerate domains' patch would go away then 
this patch needs to be merged/modified. (and most of the others as well)

I probably should respin this so it goes in *first* anyway.
Rather than doing half in the remove degenerate domains and
half here.
--
SUSE Labs, Novell Inc.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 2/5] sched: NULL domains

2005-04-05 Thread Ingo Molnar

* Nick Piggin <[EMAIL PROTECTED]> wrote:

> 2/5

> The previous patch fixed the last 2 places that directly access a
> runqueue's sched-domain and assume it cannot be NULL.
> 
> We can now use a NULL domain instead of a dummy domain to signify
> no balancing is to happen. No functional changes.
> 
> Signed-off-by: Nick Piggin <[EMAIL PROTECTED]>

Acked-by: Ingo Molnar <[EMAIL PROTECTED]>

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 2/5] sched: NULL domains

2005-04-05 Thread Ingo Molnar

* Ingo Molnar <[EMAIL PROTECTED]> wrote:

> 
> * Nick Piggin <[EMAIL PROTECTED]> wrote:
> 
> > 2/5
> 
> > The previous patch fixed the last 2 places that directly access a
> > runqueue's sched-domain and assume it cannot be NULL.
> > 
> > We can now use a NULL domain instead of a dummy domain to signify
> > no balancing is to happen. No functional changes.
> > 
> > Signed-off-by: Nick Piggin <[EMAIL PROTECTED]>
> 
> Acked-by: Ingo Molnar <[EMAIL PROTECTED]>

if the previous 'remove degenerate domains' patch would go away then 
this patch needs to be merged/modified. (and most of the others as well)

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 2/5] sched: NULL domains

2005-04-05 Thread Nick Piggin
2/5
The previous patch fixed the last 2 places that directly access a
runqueue's sched-domain and assume it cannot be NULL.

We can now use a NULL domain instead of a dummy domain to signify
no balancing is to happen. No functional changes.

Signed-off-by: Nick Piggin <[EMAIL PROTECTED]>

Index: linux-2.6/kernel/sched.c
===
--- linux-2.6.orig/kernel/sched.c   2005-04-05 16:38:40.0 +1000
+++ linux-2.6/kernel/sched.c2005-04-05 18:39:08.0 +1000
@@ -4887,7 +4887,7 @@ void __devinit cpu_attach_domain(struct 
tmp->parent = parent->parent;
}
 
-   if (sd_degenerate(sd))
+   if (sd && sd_degenerate(sd))
sd = sd->parent;
 
sched_domain_debug(sd, cpu);
@@ -5054,7 +5054,7 @@ static void __devinit arch_init_sched_do
cpus_and(cpu_default_map, cpu_default_map, cpu_online_map);
 
/*
-* Set up domains. Isolated domains just stay on the dummy domain.
+* Set up domains. Isolated domains just stay on the NULL domain.
 */
for_each_cpu_mask(i, cpu_default_map) {
int group;
@@ -5167,18 +5167,11 @@ static void __devinit arch_destroy_sched
 
 #endif /* ARCH_HAS_SCHED_DOMAIN */
 
-/*
- * Initial dummy domain for early boot and for hotplug cpu. Being static,
- * it is initialized to zero, so all balancing flags are cleared which is
- * what we want.
- */
-static struct sched_domain sched_domain_dummy;
-
 #ifdef CONFIG_HOTPLUG_CPU
 /*
  * Force a reinitialization of the sched domains hierarchy.  The domains
  * and groups cannot be updated in place without racing with the balancing
- * code, so we temporarily attach all running cpus to a "dummy" domain
+ * code, so we temporarily attach all running cpus to the NULL domain
  * which will prevent rebalancing while the sched domains are recalculated.
  */
 static int update_sched_domains(struct notifier_block *nfb,
@@ -5190,7 +5183,7 @@ static int update_sched_domains(struct n
case CPU_UP_PREPARE:
case CPU_DOWN_PREPARE:
for_each_online_cpu(i)
-   cpu_attach_domain(_domain_dummy, i);
+   cpu_attach_domain(NULL, i);
arch_destroy_sched_domains();
return NOTIFY_OK;
 
@@ -5253,7 +5246,7 @@ void __init sched_init(void)
rq->best_expired_prio = MAX_PRIO;
 
 #ifdef CONFIG_SMP
-   rq->sd = _domain_dummy;
+   rq->sd = NULL;
for (j = 1; j < 3; j++)
rq->cpu_load[j] = 0;
rq->active_balance = 0;


[patch 2/5] sched: NULL domains

2005-04-05 Thread Nick Piggin
2/5
The previous patch fixed the last 2 places that directly access a
runqueue's sched-domain and assume it cannot be NULL.

We can now use a NULL domain instead of a dummy domain to signify
no balancing is to happen. No functional changes.

Signed-off-by: Nick Piggin [EMAIL PROTECTED]

Index: linux-2.6/kernel/sched.c
===
--- linux-2.6.orig/kernel/sched.c   2005-04-05 16:38:40.0 +1000
+++ linux-2.6/kernel/sched.c2005-04-05 18:39:08.0 +1000
@@ -4887,7 +4887,7 @@ void __devinit cpu_attach_domain(struct 
tmp-parent = parent-parent;
}
 
-   if (sd_degenerate(sd))
+   if (sd  sd_degenerate(sd))
sd = sd-parent;
 
sched_domain_debug(sd, cpu);
@@ -5054,7 +5054,7 @@ static void __devinit arch_init_sched_do
cpus_and(cpu_default_map, cpu_default_map, cpu_online_map);
 
/*
-* Set up domains. Isolated domains just stay on the dummy domain.
+* Set up domains. Isolated domains just stay on the NULL domain.
 */
for_each_cpu_mask(i, cpu_default_map) {
int group;
@@ -5167,18 +5167,11 @@ static void __devinit arch_destroy_sched
 
 #endif /* ARCH_HAS_SCHED_DOMAIN */
 
-/*
- * Initial dummy domain for early boot and for hotplug cpu. Being static,
- * it is initialized to zero, so all balancing flags are cleared which is
- * what we want.
- */
-static struct sched_domain sched_domain_dummy;
-
 #ifdef CONFIG_HOTPLUG_CPU
 /*
  * Force a reinitialization of the sched domains hierarchy.  The domains
  * and groups cannot be updated in place without racing with the balancing
- * code, so we temporarily attach all running cpus to a dummy domain
+ * code, so we temporarily attach all running cpus to the NULL domain
  * which will prevent rebalancing while the sched domains are recalculated.
  */
 static int update_sched_domains(struct notifier_block *nfb,
@@ -5190,7 +5183,7 @@ static int update_sched_domains(struct n
case CPU_UP_PREPARE:
case CPU_DOWN_PREPARE:
for_each_online_cpu(i)
-   cpu_attach_domain(sched_domain_dummy, i);
+   cpu_attach_domain(NULL, i);
arch_destroy_sched_domains();
return NOTIFY_OK;
 
@@ -5253,7 +5246,7 @@ void __init sched_init(void)
rq-best_expired_prio = MAX_PRIO;
 
 #ifdef CONFIG_SMP
-   rq-sd = sched_domain_dummy;
+   rq-sd = NULL;
for (j = 1; j  3; j++)
rq-cpu_load[j] = 0;
rq-active_balance = 0;


Re: [patch 2/5] sched: NULL domains

2005-04-05 Thread Ingo Molnar

* Ingo Molnar [EMAIL PROTECTED] wrote:

 
 * Nick Piggin [EMAIL PROTECTED] wrote:
 
  2/5
 
  The previous patch fixed the last 2 places that directly access a
  runqueue's sched-domain and assume it cannot be NULL.
  
  We can now use a NULL domain instead of a dummy domain to signify
  no balancing is to happen. No functional changes.
  
  Signed-off-by: Nick Piggin [EMAIL PROTECTED]
 
 Acked-by: Ingo Molnar [EMAIL PROTECTED]

if the previous 'remove degenerate domains' patch would go away then 
this patch needs to be merged/modified. (and most of the others as well)

Ingo
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 2/5] sched: NULL domains

2005-04-05 Thread Ingo Molnar

* Nick Piggin [EMAIL PROTECTED] wrote:

 2/5

 The previous patch fixed the last 2 places that directly access a
 runqueue's sched-domain and assume it cannot be NULL.
 
 We can now use a NULL domain instead of a dummy domain to signify
 no balancing is to happen. No functional changes.
 
 Signed-off-by: Nick Piggin [EMAIL PROTECTED]

Acked-by: Ingo Molnar [EMAIL PROTECTED]

Ingo
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/