John Stultz abfdccd6af sched/wake_q: Add helper to call wake_up_q after unlock with preemption disabled
A common pattern seen when wake_qs are used to defer a wakeup
until after a lock is released is something like:
  preempt_disable();
  raw_spin_unlock(lock);
  wake_up_q(wake_q);
  preempt_enable();

So create some raw_spin_unlock*_wake() helper functions to clean
this up.

Applies on top of the fix I submitted here:
 https://lore.kernel.org/lkml/20241212222138.2400498-1-jstultz@google.com/

NOTE: I recognise the unlock()/unlock_irq()/unlock_irqrestore()
variants creates its own duplication, which we could use a macro
to generate the similar functions, but I often dislike how those
generation macros making finding the actual implementation
harder, so I left the three functions as is. If folks would
prefer otherwise, let me know and I'll switch it.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: John Stultz <jstultz@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20241217040803.243420-1-jstultz@google.com
2024-12-20 15:31:21 +01:00
..
2024-11-20 09:54:49 -08:00
2024-06-15 10:43:06 -07:00
2024-11-20 09:21:11 -08:00
2024-12-14 12:58:14 -08:00
2024-11-18 17:34:05 -08:00
2024-11-29 11:43:29 -08:00
2024-07-29 10:45:54 -07:00
2024-11-05 17:12:28 -08:00
2024-09-03 21:15:26 -07:00
2024-11-03 01:28:06 -05:00
2024-09-19 10:18:15 +02:00
2023-12-01 09:51:44 -08:00
2024-11-03 01:28:06 -05:00
2024-09-27 08:18:43 -07:00
2023-10-04 10:41:57 -07:00
2023-12-29 12:22:29 -08:00
2024-07-18 12:19:20 -07:00
2024-11-18 18:10:37 -08:00
2024-11-03 01:28:06 -05:00
2024-05-30 15:31:38 -07:00
2024-11-22 20:36:11 -08:00
2024-11-03 01:28:06 -05:00