Skip to content

Commit 82b9150

Browse files
hashbrowncipherThomas Gleixner
authored andcommitted
tick/nohz: Fix inverted return value in check_tick_dependency() fast path
Commit 5653467 ("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: 5653467 ("tick/nohz: Optimize check_tick_dependency() with early return") Signed-off-by: Josh Snyder <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Assisted-by: Claude:claude-opus-4-6 Link: https://patch.msgid.link/[email protected]
1 parent 591cd65 commit 82b9150

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/time/tick-sched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static bool check_tick_dependency(atomic_t *dep)
345345
int val = atomic_read(dep);
346346

347347
if (likely(!tracepoint_enabled(tick_stop)))
348-
return !val;
348+
return !!val;
349349

350350
if (val & TICK_DEP_MASK_POSIX_TIMER) {
351351
trace_tick_stop(0, TICK_DEP_MASK_POSIX_TIMER);

0 commit comments

Comments
 (0)