]> Git Repo - linux.git/commit
sched/wait, RCU: Introduce rcuwait machinery
authorDavidlohr Bueso <[email protected]>
Wed, 11 Jan 2017 15:22:25 +0000 (07:22 -0800)
committerIngo Molnar <[email protected]>
Sat, 14 Jan 2017 10:14:33 +0000 (11:14 +0100)
commit8f95c90ceb541a38ac16fec48c05142ef1450c25
tree53675e769e1b84b81d25e22a68983b978eff72bd
parent642fa448ae6b3a4e5e8737054a094173405b7643
sched/wait, RCU: Introduce rcuwait machinery

rcuwait provides support for (single) RCU-safe task wait/wake functionality,
with the caveat that it must not be called after exit_notify(), such that
we avoid racing with rcu delayed_put_task_struct callbacks, task_struct
being rcu unaware in this context -- for which we similarly have
task_rcu_dereference() magic, but with different return semantics, which
can conflict with the wakeup side.

The interfaces are quite straightforward:

  rcuwait_wait_event()
  rcuwait_wake_up()

More details are in the comments, but it's perhaps worth mentioning at least,
that users must provide proper serialization when waiting on a condition, and
avoid corrupting a concurrent waiter. Also care must be taken between the task
and the condition for when calling the wakeup -- we cannot miss wakeups. When
porting users, this is for example, a given when using waitqueues in that
everything is done under the q->lock. As such, it can remove sources of non
preemptable unbounded work for realtime.

Signed-off-by: Davidlohr Bueso <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Oleg Nesterov <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
include/linux/rcuwait.h [new file with mode: 0644]
kernel/exit.c
This page took 0.054181 seconds and 4 git commands to generate.