Skip to content

Commit

Permalink
x86/entry: Use should_resched() in idtentry_exit_cond_resched()
Browse files Browse the repository at this point in the history
The TIF_NEED_RESCHED bit is inlined on x86 into the preemption counter.
By using should_resched(0) instead of need_resched() the same check can
be performed which uses the same variable as 'preempt_count()` which was
issued before.

Use should_resched(0) instead need_resched().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Sebastian Andrzej Siewior committed Sep 13, 2021
1 parent 240c44c commit e2cb767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/entry/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ void irqentry_exit_cond_resched(void)
rcu_irq_exit_check_preempt();
if (IS_ENABLED(CONFIG_DEBUG_ENTRY))
WARN_ON_ONCE(!on_thread_stack());
if (need_resched())
if (should_resched(0))
preempt_schedule_irq();
}
}
Expand Down

0 comments on commit e2cb767

Please sign in to comment.