Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tick/nohz: Fix inverted return value in check_tick_dependency() fast path

Commit 56534673cea7f ("tick/nohz: Optimize check_tick_dependency() with
early return") added a fast path that returns !val when the tick_stop
tracepoint is disabled.

This is inverted: the slow path returns true when a dependency IS found
(val != 0), but !val returns true when val is zero (no dependency). The
result is that can_stop_full_tick() sees "dependency found" when there are
none, and the tick never stops on nohz_full CPUs.

Fix this by returning !!val instead of !val, matching the slow-path semantics.

Fixes: 56534673cea7f ("tick/nohz: Optimize check_tick_dependency() with early return")
Signed-off-by: Josh Snyder <josh@code406.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Assisted-by: Claude:claude-opus-4-6
Link: https://patch.msgid.link/20260402-fix-idle-tick2-v1-1-eecb589649d3@code406.com

authored by

Josh Snyder and committed by
Thomas Gleixner
82b91505 591cd656

+1 -1
+1 -1
kernel/time/tick-sched.c
··· 345 345 int val = atomic_read(dep); 346 346 347 347 if (likely(!tracepoint_enabled(tick_stop))) 348 - return !val; 348 + return !!val; 349 349 350 350 if (val & TICK_DEP_MASK_POSIX_TIMER) { 351 351 trace_tick_stop(0, TICK_DEP_MASK_POSIX_TIMER);