[tip: locking/core] sched: Remove the unused preempt_offset parameter of __cant_sleep()
"tip-bot2 for Boqun Feng" <[email protected]>
| Newsgroups | gmane.linux.kernel |
|---|---|
| Message-ID | <178622210690.442315.3396960859679183692.tip-bot2@tip-bot2> |
The following commit has been merged into the locking/core branch of tip: Commit-ID: 1cda40c48e295f8ad16bd5401591d7e6e5bcb591 Gitweb: https://git.kernel.org/tip/1cda40c48e295f8ad16bd5401591d7e6e5bcb591 Author: Boqun Feng <[email protected]> AuthorDate: Tue, 04 Aug 2026 09:14:30 -07:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Sat, 08 Aug 2026 22:44:07 +02:00 sched: Remove the unused preempt_offset parameter of __cant_sleep() The preempt_offset is always 0 in all the callsites of __cant_sleep(), hence remove it. It also allows us to clear up the code a bit by no longer using a "preempt_count() > .." comparison. Signed-off-by: Boqun Feng <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://patch.msgid.link/[email protected] --- include/linux/kernel.h | 4 ++-- kernel/sched/core.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e5570a1..24414c7 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -72,7 +72,7 @@ extern int dynamic_might_resched(void); #ifdef CONFIG_DEBUG_ATOMIC_SLEEP extern void __might_resched(const char *file, int line, unsigned int offsets); extern void __might_sleep(const char *file, int line); -extern void __cant_sleep(const char *file, int line, int preempt_offset); +extern void __cant_sleep(const char *file, int line); extern void __cant_migrate(const char *file, int line); /** @@ -95,7 +95,7 @@ extern void __cant_migrate(const char *file, int line); * this macro will print a stack trace if it is executed with preemption enabled */ # define cant_sleep() \ - do { __cant_sleep(__FILE__, __LINE__, 0); } while (0) + do { __cant_sleep(__FILE__, __LINE__); } while (0) # define sched_annotate_sleep() (current->task_state_change = 0) /** diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9622670..aa116da 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -9199,7 +9199,7 @@ void __might_resched(const char *file, int line, unsigned int offsets) } EXPORT_SYMBOL(__might_resched); -void __cant_sleep(const char *file, int line, int preempt_offset) +void __cant_sleep(const char *file, int line) { static unsigned long prev_jiffy; @@ -9209,7 +9209,7 @@ void __cant_sleep(const char *file, int line, int preempt_offset) if (!IS_ENABLED(CONFIG_PREEMPT_COUNT)) return; - if (preempt_count() > preempt_offset) + if (preempt_count()) return; if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)