Skip to content

Commit

Permalink
sched: Fix isolcpus boot option
Browse files Browse the repository at this point in the history
commit bdddd29 upstream.

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 49557e6 (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 <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Cc: [email protected]
Cc: Linus Torvalds <[email protected]>
Cc: <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Tested-by: Anton Blanchard <[email protected]>
  • Loading branch information
rustyrussell authored and gregkh committed Jan 28, 2010
1 parent eb9dbd9 commit 08b84be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -8061,6 +8061,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;
}
Expand Down Expand Up @@ -9591,7 +9592,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();
Expand Down

0 comments on commit 08b84be

Please sign in to comment.