OSDN Git Service

RCU, workqueue: Implement rcu_work
authorTejun Heo <tj@kernel.org>
Wed, 14 Mar 2018 19:45:13 +0000 (12:45 -0700)
committerTejun Heo <tj@kernel.org>
Mon, 19 Mar 2018 17:12:03 +0000 (10:12 -0700)
commit05f0fe6b74dbd7690a4cbd61810948b7d575576a
treef8aa6fef133b092f7dac48a8fd30db9319aadefd
parentc698ca5278934c0ae32297a8725ced2e27585d7f
RCU, workqueue: Implement rcu_work

There are cases where RCU callback needs to be bounced to a sleepable
context.  This is currently done by the RCU callback queueing a work
item, which can be cumbersome to write and confusing to read.

This patch introduces rcu_work, a workqueue work variant which gets
executed after a RCU grace period, and converts the open coded
bouncing in fs/aio and kernel/cgroup.

v3: Dropped queue_rcu_work_on().  Documented rcu grace period behavior
    after queue_rcu_work().

v2: Use rcu_barrier() instead of synchronize_rcu() to wait for
    completion of previously queued rcu callback as per Paul.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/workqueue.h
kernel/workqueue.c