-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unnecessary RCU grace period chaining #15
base: rcu-dev
Are you sure you want to change the base?
Conversation
Master branch: 4b9dfbb Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/rcu/list/?series=684412
conflict:
|
5ca9bde
to
f965c82
Compare
996bf5c
to
00c153b
Compare
Master branch: fa70e60 |
112760b
to
7745abd
Compare
87e7989
to
fa70e60
Compare
Master branch: fa70e60 |
7745abd
to
3f7d87e
Compare
Master branch: fa70e60 |
3f7d87e
to
5e0d56c
Compare
Master branch: fa70e60 |
5e0d56c
to
0892932
Compare
Master branch: fa70e60 |
0892932
to
cbbf01f
Compare
Master branch: fa70e60 |
cbbf01f
to
c98ad5b
Compare
Master branch: fa70e60 |
c98ad5b
to
2c30954
Compare
Master branch: fa70e60 |
2c30954
to
05b5b6c
Compare
Master branch: fa70e60 |
05b5b6c
to
260938f
Compare
Master branch: fa70e60 |
260938f
to
a23361c
Compare
Master branch: fa70e60 |
a23361c
to
323b6f8
Compare
Master branch: fa70e60 |
323b6f8
to
bc6d7cc
Compare
Master branch: fa70e60 |
bc6d7cc
to
759167c
Compare
Master branch: fa70e60 |
759167c
to
2f582b5
Compare
As an accident of implementation, an RCU Tasks Trace grace period also acts as an RCU grace period. However, this could change at any time. This commit therefore creates an rcu_trace_implies_rcu_gp() that currently returns true to codify this accident. Code relying on this accident must call this function to verify that this accident is still happening. Reported-by: Hou Tao <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Martin KaFai Lau <[email protected]>
The memory free logic in bpf memory allocator chains a RCU Tasks Trace grace period and a normal RCU grace period one after the other, so it can ensure that both sleepable and non-sleepable programs have finished. With the introduction of rcu_trace_implies_rcu_gp(), __free_rcu_tasks_trace() can check whether or not a normal RCU grace period has also passed after a RCU Tasks Trace grace period has passed. If it is true, freeing these elements directly, else freeing through call_rcu(). Signed-off-by: Hou Tao <[email protected]>
Local storage map is accessible for both sleepable and non-sleepable bpf program, and its memory is freed by using both call_rcu_tasks_trace() and kfree_rcu() to wait for both RCU-tasks-trace grace period and RCU grace period to pass. With the introduction of rcu_trace_implies_rcu_gp(), both bpf_selem_free_rcu() and bpf_local_storage_free_rcu() can check whether or not a normal RCU grace period has also passed after a RCU-tasks-trace grace period has passed. If it is true, it is safe to call kfree() directly. Signed-off-by: Hou Tao <[email protected]>
To support both sleepable and normal uprobe bpf program, the freeing of trace program array chains a RCU-tasks-trace grace period and a normal RCU grace period one after the other. With the introduction of rcu_trace_implies_rcu_gp(), __bpf_prog_array_free_sleepable_cb() can check whether or not a normal RCU grace period has also passed after a RCU-tasks-trace grace period has passed. If it is true, it is safe to invoke kfree() directly. Signed-off-by: Hou Tao <[email protected]>
Master branch: fa70e60 |
2f582b5
to
32140fa
Compare
Pull request for series with
subject: Remove unnecessary RCU grace period chaining
version: 1
url: https://patchwork.kernel.org/project/rcu/list/?series=684412