History

sched: Fix boot crash by zalloc()ing most of the cpu masks

I got a boot crash when forcing cpumasks offstack on 32 bit, because find_new_ilb() returned 3 on my UP system (nohz.cpu_mask wasn't zeroed). AFAICT the others need to be zeroed too: only nohz.ilb_grp_nohz_mask is initialized before use.

Rusty Russell committed 17 years ago

Commit 49557e61 parent f685cea1 file · +3 −3Browse files

Unified · Split

kernel/sched.c+3−3
@@ -9535,13 +9535,13 @@ void __init sched_init(void) · 9534 unmodified lines
95359535 current->sched_class = &fair_sched_class;
95369536
95379537 /* Allocate the nohz_cpu_mask if CONFIG_CPUMASK_OFFSTACK */
9538− alloc_cpumask_var(&nohz_cpu_mask, GFP_NOWAIT);
9538+ zalloc_cpumask_var(&nohz_cpu_mask, GFP_NOWAIT);
95399539 #ifdef CONFIG_SMP
95409540 #ifdef CONFIG_NO_HZ
9541− alloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT);
9541+ zalloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT);
95429542 alloc_cpumask_var(&nohz.ilb_grp_nohz_mask, GFP_NOWAIT);
95439543 #endif
9544− alloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
9544+ zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
95459545 #endif /* SMP */
95469546
95479547 perf_event_init();