Skip to content

Commit

Permalink
tick: Use zalloc_cpumask_var for allocating offstack cpumasks
Browse files Browse the repository at this point in the history
commit b352bc1 (tick: Convert broadcast cpu bitmaps to
cpumask_var_t) broke CONFIG_CPUMASK_OFFSTACK in a very subtle way.

Instead of allocating the cpumasks with zalloc_cpumask_var it uses
alloc_cpumask_var, so we can get random data there, which of course
confuses the logic completely and causes random failures.

Reported-and-tested-by: Dave Jones <davej@redhat.com>
Reported-and-tested-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1305032015060.2990@ionos
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed May 5, 2013
1 parent ce85722 commit fbd44a6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kernel/time/tick-broadcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,11 +785,11 @@ bool tick_broadcast_oneshot_available(void)

void __init tick_broadcast_init(void)
{
alloc_cpumask_var(&tick_broadcast_mask, GFP_NOWAIT);
alloc_cpumask_var(&tmpmask, GFP_NOWAIT);
zalloc_cpumask_var(&tick_broadcast_mask, GFP_NOWAIT);
zalloc_cpumask_var(&tmpmask, GFP_NOWAIT);
#ifdef CONFIG_TICK_ONESHOT
alloc_cpumask_var(&tick_broadcast_oneshot_mask, GFP_NOWAIT);
alloc_cpumask_var(&tick_broadcast_pending_mask, GFP_NOWAIT);
alloc_cpumask_var(&tick_broadcast_force_mask, GFP_NOWAIT);
zalloc_cpumask_var(&tick_broadcast_oneshot_mask, GFP_NOWAIT);
zalloc_cpumask_var(&tick_broadcast_pending_mask, GFP_NOWAIT);
zalloc_cpumask_var(&tick_broadcast_force_mask, GFP_NOWAIT);
#endif
}

0 comments on commit fbd44a6

Please sign in to comment.