diff options
author | Jens Axboe <axboe@kernel.dk> | 2020-03-08 20:07:28 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-03-08 20:07:28 -0600 |
commit | 805b13adde3964c78cba125a15527e88c19f87b3 (patch) | |
tree | c79c1839ac977bc84f7b8f6bed0038bf3f95b8e2 /include/linux/socket.h | |
parent | f0e20b8943509d81200cef5e30af2adfddba0f5c (diff) | |
download | linux-805b13adde3964c78cba125a15527e88c19f87b3.tar.gz linux-805b13adde3964c78cba125a15527e88c19f87b3.tar.bz2 linux-805b13adde3964c78cba125a15527e88c19f87b3.zip |
io_uring: ensure RCU callback ordering with rcu_barrier()
After more careful studying, Paul informs me that we cannot rely on
ordering of RCU callbacks in the way that the the tagged commit did.
The current construct looks like this:
void C(struct rcu_head *rhp)
{
do_something(rhp);
call_rcu(&p->rh, B);
}
call_rcu(&p->rh, A);
call_rcu(&p->rh, C);
and we're relying on ordering between A and B, which isn't guaranteed.
Make this explicit instead, and have a work item issue the rcu_barrier()
to ensure that A has run before we manually execute B.
While thorough testing never showed this issue, it's dependent on the
per-cpu load in terms of RCU callbacks. The updated method simplifies
the code as well, and eliminates the need to maintain an rcu_head in
the fileset data.
Fixes: c1e2148f8ecb ("io_uring: free fixed_file_data after RCU grace period")
Reported-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/socket.h')
0 files changed, 0 insertions, 0 deletions