All of lore.kernel.org
 help / color / mirror / Atom feed
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,
	Linus Torvalds <torvalds@linux-foundation.org>,
	stable@kernel.org
Subject: [PATCH] sched: Fix isolcpus boot option
Date: Wed, 2 Dec 2009 14:09:16 +1030	[thread overview]
Message-ID: <200912021409.17013.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.

I introduced this regression in 49557e620339cb13 (sched: Fix boot
crash by zalloc()ing most of the cpu masks).

Use the bootmem allocator if they set isolcpus=, otherwise allocate
and zero like normal.

Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Tested-by: Anton Blanchard <anton@samba.org>
Cc: stable@kernel.org

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();

  parent reply	other threads:[~2009-12-02  3:39 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
2009-12-02  3:39 ` Rusty Russell [this message]
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=200912021409.17013.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 \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.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.