Re: [PATCH] sched isolcpus=1 related OOPS in 2.6.9

From: devik
Date: Fri Dec 03 2004 - 13:17:07 EST


> You are correct, of course. If "isolcpus" is used, the isolated
> cpu(s) (in <cpu_isolated_map>) are not init like the remaining
> cpus are.
>
> I don't know what's intended here... but it's not the divide by 0.

A patch is attached which fixes problems with isolated
domains for me. I hope it is correct :-) I will try on
real SMP when I will be in work (now it boots on Boochs).

enjoy,

Martin Devera aka devik
Linux kernel QoS/HTB maintainer
http://luxik.cdi.cz/~devik/
--- linux-2.6.9/kernel/sched.c Mon Oct 18 23:54:55 2004
+++ kernel/sched.c Fri Dec 3 19:06:04 2004
@@ -4480,7 +4480,7 @@
#ifdef CONFIG_NUMA
sd->span = nodemask;
#else
- sd->span = cpu_possible_map;
+ sd->span = cpu_default_map;
#endif
sd->parent = p;
sd->groups = &sched_group_phys[group];
@@ -4512,11 +4512,14 @@

/* Set up isolated groups */
for_each_cpu_mask(i, cpu_isolated_map) {
+ int group;
cpumask_t mask;
cpus_clear(mask);
cpu_set(i, mask);
init_sched_build_groups(sched_group_isolated, mask,
&cpu_to_isolated_group);
+ group = cpu_to_isolated_group(i);
+ sched_group_isolated[group].cpu_power = SCHED_LOAD_SCALE;
}

#ifdef CONFIG_NUMA
@@ -4532,7 +4535,7 @@
&cpu_to_phys_group);
}
#else
- init_sched_build_groups(sched_group_phys, cpu_possible_map,
+ init_sched_build_groups(sched_group_phys, cpu_default_map,
&cpu_to_phys_group);
#endif

@@ -4634,7 +4637,7 @@
cpus_or(groupmask, groupmask, group->cpumask);

cpumask_scnprintf(str, NR_CPUS, group->cpumask);
- printk(" %s", str);
+ printk(" %s[%ld]", str, group->cpu_power);

group = group->next;
} while (group != sd->groups);