diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2021-08-15 23:28:08 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2021-08-17 17:18:15 +0200 |
commit | b576e640ce5e22673e12949cf14ae3cb18d9b859 (patch) | |
tree | fc43cf3953ecad51677d7f4759e9bc9f84bf78e6 /kernel/locking/rtmutex_common.h | |
parent | locking/rtmutex: Add wake_state to rt_mutex_waiter (diff) | |
download | linux-b576e640ce5e22673e12949cf14ae3cb18d9b859.tar.xz linux-b576e640ce5e22673e12949cf14ae3cb18d9b859.zip |
locking/rtmutex: Provide rt_wake_q_head and helpers
To handle the difference between wakeups for regular sleeping locks (mutex,
rtmutex, rw_semaphore) and the wakeups for 'sleeping' spin/rwlocks on
PREEMPT_RT enabled kernels correctly, it is required to provide a
wake_q_head construct which allows to keep them separate.
Provide a wrapper around wake_q_head and the required helpers, which will be
extended with the state handling later.
No functional change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210815211303.139337655@linutronix.de
Diffstat (limited to 'kernel/locking/rtmutex_common.h')
-rw-r--r-- | kernel/locking/rtmutex_common.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h index fcc55de46b28..9e2f1dbf6482 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h @@ -39,6 +39,20 @@ struct rt_mutex_waiter { u64 deadline; }; +/** + * rt_wake_q_head - Wrapper around regular wake_q_head to support + * "sleeping" spinlocks on RT + * @head: The regular wake_q_head for sleeping lock variants + */ +struct rt_wake_q_head { + struct wake_q_head head; +}; + +#define DEFINE_RT_WAKE_Q(name) \ + struct rt_wake_q_head name = { \ + .head = WAKE_Q_HEAD_INITIALIZER(name.head), \ + } + /* * PI-futex support (proxy locking functions, etc.): */ |