From: Ingo Molnar Date: Fri, 12 Dec 2008 12:48:57 +0000 (+0100) Subject: Merge branch 'sched/core' into cpus4096 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=45ab6b0c76d0e4cce5bd608ccf97b0f6b20f18df;p=linux-beck.git Merge branch 'sched/core' into cpus4096 Conflicts: include/linux/ftrace.h kernel/sched.c --- 45ab6b0c76d0e4cce5bd608ccf97b0f6b20f18df diff --cc include/linux/ftrace.h index 11cac81eed08,9c5bc6be2b09..985b28dc2ba9 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@@ -6,9 -6,8 +6,10 @@@ #include #include #include + #include #include +#include +#include #ifdef CONFIG_FUNCTION_TRACER diff --cc kernel/sched.c index 4ed9f588faa6,ad7b93be5691..e00c92d22655 --- a/kernel/sched.c +++ b/kernel/sched.c @@@ -3676,12 -3685,9 +3685,12 @@@ out_balanced static void idle_balance(int this_cpu, struct rq *this_rq) { struct sched_domain *sd; - int pulled_task = -1; + int pulled_task = 0; unsigned long next_balance = jiffies + HZ; - cpumask_t tmpmask; + cpumask_var_t tmpmask; + + if (!alloc_cpumask_var(&tmpmask, GFP_ATOMIC)) + return; for_each_domain(this_cpu, sd) { unsigned long interval; @@@ -7711,13 -7670,19 +7724,19 @@@ static struct sched_domain_attr *dattr_ /* * Special case: If a kmalloc of a doms_cur partition (array of - * cpumask_t) fails, then fallback to a single sched domain, - * as determined by the single cpumask_t fallback_doms. + * cpumask) fails, then fallback to a single sched domain, + * as determined by the single cpumask fallback_doms. */ -static cpumask_t fallback_doms; +static cpumask_var_t fallback_doms; - void __attribute__((weak)) arch_update_cpu_topology(void) + /* + * arch_update_cpu_topology lets virtualized architectures update the + * cpu core maps. It is supposed to return 1 if the topology changed + * or 0 if it stayed the same. + */ + int __attribute__((weak)) arch_update_cpu_topology(void) { + return 0; } /* @@@ -7821,8 -7788,8 +7844,8 @@@ void partition_sched_domains(int ndoms_ /* Destroy deleted domains */ for (i = 0; i < ndoms_cur; i++) { - for (j = 0; j < n; j++) { + for (j = 0; j < n && !new_topology; j++) { - if (cpus_equal(doms_cur[i], doms_new[j]) + if (cpumask_equal(&doms_cur[i], &doms_new[j]) && dattrs_equal(dattr_cur, i, dattr_new, j)) goto match1; } @@@ -7841,8 -7808,8 +7864,8 @@@ match1 /* Build new domains */ for (i = 0; i < ndoms_new; i++) { - for (j = 0; j < ndoms_cur; j++) { + for (j = 0; j < ndoms_cur && !new_topology; j++) { - if (cpus_equal(doms_new[i], doms_cur[j]) + if (cpumask_equal(&doms_new[i], &doms_cur[j]) && dattrs_equal(dattr_new, i, dattr_cur, j)) goto match2; }