[tip: sched/core] sched/headers: Inline raw_spin_rq_unlock()
From: tip-bot2 for Xie Yuanbin
Date: Fri Mar 06 2026 - 00:29:17 EST
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 54a66e431eeacf23e1dc47cb3507f2d0c068aaf0
Gitweb: https://git.kernel.org/tip/54a66e431eeacf23e1dc47cb3507f2d0c068aaf0
Author: Xie Yuanbin <qq570070308@xxxxxxxxx>
AuthorDate: Tue, 17 Feb 2026 00:49:49 +08:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Fri, 06 Mar 2026 06:21:48 +01:00
sched/headers: Inline raw_spin_rq_unlock()
raw_spin_rq_unlock() is short, and is called in some hot code paths
such as finish_lock_switch().
Inline raw_spin_rq_unlock() to micro-optimize performance a bit.
Signed-off-by: Xie Yuanbin <qq570070308@xxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Link: https://patch.msgid.link/20260216164950.147617-3-qq570070308@xxxxxxxxx
---
kernel/sched/core.c | 5 -----
kernel/sched/sched.h | 9 ++++++---
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index bfd280e..b59bab2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -687,11 +687,6 @@ bool raw_spin_rq_trylock(struct rq *rq)
}
}
-void raw_spin_rq_unlock(struct rq *rq)
-{
- raw_spin_unlock(rq_lockp(rq));
-}
-
/*
* double_rq_lock - safely lock two runqueues
*/
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index fa2237e..953d89d 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1607,15 +1607,18 @@ extern void raw_spin_rq_lock_nested(struct rq *rq, int subclass)
extern bool raw_spin_rq_trylock(struct rq *rq)
__cond_acquires(true, __rq_lockp(rq));
-extern void raw_spin_rq_unlock(struct rq *rq)
- __releases(__rq_lockp(rq));
-
static inline void raw_spin_rq_lock(struct rq *rq)
__acquires(__rq_lockp(rq))
{
raw_spin_rq_lock_nested(rq, 0);
}
+static inline void raw_spin_rq_unlock(struct rq *rq)
+ __releases(__rq_lockp(rq))
+{
+ raw_spin_unlock(rq_lockp(rq));
+}
+
static inline void raw_spin_rq_lock_irq(struct rq *rq)
__acquires(__rq_lockp(rq))
{