Re: [PATCH 2/2] locking/rwbase_rt: Lockless reader waking up a writer

From: Davidlohr Bueso
Date: Wed Sep 01 2021 - 19:03:32 EST


On Wed, 01 Sep 2021, Bueso wrote:

As with the rest of our sleeping locks, use a wake_q to
allow waking up the writer without having to hold the
wait_lock across the operation. While this is ideally
for batching wakeups, single wakeup usage as still shown
to be beneficial vs the cost of try_to_wakeup when the
lock is contended.

Signed-off-by: Davidlohr Bueso <dbueso@xxxxxxx>
---
kernel/locking/rwbase_rt.c | 4 +++-
kernel/sched/core.c | 16 +++++++++++++---

Bleh, this of course is missing:

diff --git a/include/linux/sched/wake_q.h b/include/linux/sched/wake_q.h
index 06cd8fb2f409..695efd987b56 100644
--- a/include/linux/sched/wake_q.h
+++ b/include/linux/sched/wake_q.h
@@ -62,5 +62,6 @@ static inline bool wake_q_empty(struct wake_q_head *head)
extern void wake_q_add(struct wake_q_head *head, struct task_struct *task);
extern void wake_q_add_safe(struct wake_q_head *head, struct task_struct *task);
extern void wake_up_q(struct wake_q_head *head);
+extern void wake_up_q_state(struct wake_q_head *head, unsigned int state);
#endif /* _LINUX_SCHED_WAKE_Q_H */