From: Rusty Russell <rusty@rustcorp.com.au>
To: Anton Blanchard <anton@samba.org>
Cc: mingo@elte.hu, peterz@infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: Fix isolcpus boot option
Date: Tue, 1 Dec 2009 11:14:09 +1030 [thread overview]
Message-ID: <200912011114.09476.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20091130000532.GW32182@kryten>
On Mon, 30 Nov 2009 10:35:32 am Anton Blanchard wrote:
>
> We allocate and zero cpu_isolated_map after the isolcpus __setup option
> has run. This means cpu_isolated_map always ends up empty and if
> CPUMASK_OFFSTACK is enabled we write to a cpumask that hasn't been
> allocated.
>
> To keep the fix to a minimum this patch stores a pointer to the cmdline
> option and parses it after we allocate and zero the cpumask.
I introduced this regression in:
commit 49557e620339cb134127b5bfbcfecc06b77d0232
Author: Rusty Russell <rusty@rustcorp.com.au>
Date: Mon Nov 2 20:37:20 2009 +1030
sched: Fix boot crash by zalloc()ing most of the cpu masks
But this change made isolcpus= never work, CPUMASK_OFFSTACK or no.
Your patch works and is minimal.
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Thanks,
Rusty.
PS. This would have also worked:
diff --git a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -8045,6 +8045,7 @@ static cpumask_var_t cpu_isolated_map;
/* Setup the mask of cpus configured for isolated domains */
static int __init isolated_cpu_setup(char *str)
{
+ alloc_bootmem_cpumask_var(&cpu_isolated_map);
cpulist_parse(str, cpu_isolated_map);
return 1;
}
@@ -9571,7 +9572,9 @@ void __init sched_init(void)
zalloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT);
alloc_cpumask_var(&nohz.ilb_grp_nohz_mask, GFP_NOWAIT);
#endif
- zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
+ /* May be allocated at isolcpus cmdline parse time */
+ if (cpu_isolated_map == NULL)
+ zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
#endif /* SMP */
perf_event_init();
next prev parent reply other threads:[~2009-12-01 0:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-30 0:05 [PATCH] sched: Fix isolcpus boot option Anton Blanchard
2009-11-30 8:31 ` Peter Zijlstra
2009-12-01 0:44 ` Rusty Russell [this message]
2009-12-02 3:39 ` Rusty Russell
2009-12-02 10:45 ` [tip:sched/core] " tip-bot for Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200912011114.09476.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=anton@samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.