-
Notifications
You must be signed in to change notification settings - Fork 111
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
bpf: Refactor active lock management #8007
Conversation
Upstream branch: 77017b9 |
Upstream branch: 77017b9 |
46786cc
to
a460a44
Compare
0e4003e
to
5e2942e
Compare
Upstream branch: f2daa5a |
a460a44
to
b9dd517
Compare
5e2942e
to
3e790e1
Compare
When bpf_spin_lock was introduced originally, there was deliberation on whether to use an array of lock IDs, but since bpf_spin_lock is limited to holding a single lock at any given time, we've been using a single ID to identify the held lock. In preparation for introducing spin locks that can be taken multiple times, introduce support for acquiring multiple lock IDs. For this purpose, reuse the acquired_refs array and store both lock and pointer references. We tag the entry with REF_TYPE_PTR or REF_TYPE_BPF_LOCK to disambiguate and find the relevant entry. The ptr field is used to track the map_ptr or btf (for bpf_obj_new allocations) to ensure locks can be matched with protected fields within the same "allocation", i.e. bpf_obj_new object or map value. The struct active_lock is changed to a boolean as the state is part of the acquired_refs array, and we only need active_lock as a cheap way of detecting lock presence. Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]>
Upstream branch: 9a78313 |
b9dd517
to
60c4dba
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=906100 expired. Closing PR. |
Pull request for series with
subject: bpf: Refactor active lock management
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=905801