From a989a09a623cefa1d00ef6c47d676f2114cddecd Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 25 Nov 2008 02:35:12 +1030 Subject: [PATCH] --- yaml --- r: 125327 b: refs/heads/master c: 4212823fb459eacc8098dd420bb68ebb9917989d h: refs/heads/master i: 125325: 139ffb5eca2e631a0af0e6af1d475d0585adc5d3 125323: 6ac775b477230d7f5b7f0368ce31b812a497df8e 125319: 89a0a79e99de55a48161f5d4b5442c7c2b17564e 125311: 187885d34e5b261ebf5966bec7ae8111235f2fa2 v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 42fee1c63f78..0ed15a631298 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: dcc30a35f71bcf51f1e9b336dc5e41923071509a +refs/heads/master: 4212823fb459eacc8098dd420bb68ebb9917989d diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 526618fe4a78..42588ad93b25 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -7697,10 +7697,10 @@ static struct sched_domain_attr *dattr_cur; /* * 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) { @@ -7719,7 +7719,7 @@ static int arch_init_sched_domains(const cpumask_t *cpu_map) ndoms_cur = 1; doms_cur = kmalloc(sizeof(cpumask_t), GFP_KERNEL); if (!doms_cur) - doms_cur = &fallback_doms; + doms_cur = fallback_doms; cpumask_andnot(doms_cur, cpu_map, cpu_isolated_map); dattr_cur = NULL; err = build_sched_domains(doms_cur); @@ -7818,7 +7818,7 @@ void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, if (doms_new == NULL) { ndoms_cur = 0; - doms_new = &fallback_doms; + doms_new = fallback_doms; cpumask_andnot(&doms_new[0], cpu_online_mask, cpu_isolated_map); WARN_ON_ONCE(dattr_new); } @@ -7838,7 +7838,7 @@ void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, } /* Remember the new sched domains */ - if (doms_cur != &fallback_doms) + if (doms_cur != fallback_doms) kfree(doms_cur); kfree(dattr_cur); /* kfree(NULL) is safe */ doms_cur = doms_new; @@ -8011,6 +8011,8 @@ void __init sched_init_smp(void) BUG(); sched_init_granularity(); free_cpumask_var(non_isolated_cpus); + + alloc_cpumask_var(&fallback_doms, GFP_KERNEL); } #else void __init sched_init_smp(void)