-
Notifications
You must be signed in to change notification settings - Fork 6
Introduce local_storage exclusive caching #334
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
Conversation
Master branch: 0d7fefe |
Master branch: 0e5aefa |
b64872c
to
a9427a6
Compare
Master branch: dcf456c |
a9427a6
to
e651918
Compare
Master branch: c7655df |
e651918
to
fb5c8eb
Compare
Master branch: 127e7dc |
fb5c8eb
to
8cd0ffa
Compare
Master branch: db69264 |
8cd0ffa
to
10a353e
Compare
Master branch: e1a34e1 |
10a353e
to
04ad27f
Compare
Master branch: 0ed6ff5 |
04ad27f
to
f375fdf
Compare
0ed6ff5
to
9d87e41
Compare
Master branch: 9d87e41 |
f375fdf
to
110a4d9
Compare
Master branch: 920fd5e |
110a4d9
to
9b62af2
Compare
Master branch: 6a12b8e |
9b62af2
to
a861147
Compare
Allow local_storage maps to claim exclusive use of a cache slot in struct bpf_local_storage's cache. When a local_storage map claims a slot and is cached in via bpf_local_storage_lookup, it will not be replaced until the map is free'd. As a result, after a local_storage map is alloc'd for a specific bpf_local_storage, lookup calls after the first will quickly find the correct map. When requesting an exclusive cache slot, bpf_local_storage_cache_idx_get can now fail if all slots are already claimed. Because a map's cache_idx is assigned when the bpf_map is allocated - which occurs before the program runs - the map load and subsequent prog load will fail. A bit in struct bpf_map's map_extra is used to designate whether a map would like to claim an exclusive slot. Similarly, bitmap idx_exclusive is added to bpf_local_storage_cache to track whether a slot is exclusively claimed. Functions that manipulate the cache are modified to test for BPF_LOCAL_STORAGE_FORCE_CACHE bit and test/set idx_exclusive where necessary. When a map exclusively claims a cache slot, non-exclusive local_storage maps which were previously assigned the same cache_idx are not migrated to unclaimed cache_idx. Such a migration would require full iteration of the cache list and necessitate a reverse migration on map free to even things out. Since a used cache slot will only be exclusively claimed if no empty slot exists, the additional complexity was deemed unnecessary. Signed-off-by: Dave Marchevsky <[email protected]>
Master branch: b71a2eb |
Validate local_storage exclusive caching functionality: * Adding >BPF_LOCAL_STORAGE_CACHE_SIZE task_storage maps w/ BPF_LOCAL_STORAGE_FORCE_CACHE results in failure to load program as there are free slots to claim. * Adding BPF_LOCAL_STORAGE_CACHE_SIZE task_storage maps w/ FORCE_CACHE succeeds and results in a filled idx_bitmap for the cache. After first bpf_task_storage_get call for each map, the map's local storage data is in the cache slot. Subsequent bpf_task_storage_get calls to non-exclusive-cached maps don't replace exclusive-cached maps. Signed-off-by: Dave Marchevsky <[email protected]>
BPF_LOCAL_STORAGE_CACHE_SIZE is defined elsewhere in the same header. Signed-off-by: Dave Marchevsky <[email protected]>
a861147
to
815d38a
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=633549 expired. Closing PR. |
Add a test case which replaces an active ingress qdisc while keeping the miniq in-tact during the transition period to the new clsact qdisc. # ./vmtest.sh -- ./test_progs -t tc_link [...] ./test_progs -t tc_link [ 3.412871] bpf_testmod: loading out-of-tree module taints kernel. [ 3.413343] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel #332 tc_links_after:OK #333 tc_links_append:OK #334 tc_links_basic:OK #335 tc_links_before:OK #336 tc_links_chain_classic:OK #337 tc_links_chain_mixed:OK #338 tc_links_dev_chain0:OK #339 tc_links_dev_cleanup:OK #340 tc_links_dev_mixed:OK #341 tc_links_ingress:OK #342 tc_links_invalid:OK #343 tc_links_prepend:OK #344 tc_links_replace:OK #345 tc_links_revision:OK Summary: 14/0 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann <[email protected]> Cc: Martin KaFai Lau <[email protected]>
Add a test case which replaces an active ingress qdisc while keeping the miniq in-tact during the transition period to the new clsact qdisc. # ./vmtest.sh -- ./test_progs -t tc_link [...] ./test_progs -t tc_link [ 3.412871] bpf_testmod: loading out-of-tree module taints kernel. [ 3.413343] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel #332 tc_links_after:OK #333 tc_links_append:OK #334 tc_links_basic:OK #335 tc_links_before:OK #336 tc_links_chain_classic:OK #337 tc_links_chain_mixed:OK #338 tc_links_dev_chain0:OK #339 tc_links_dev_cleanup:OK #340 tc_links_dev_mixed:OK #341 tc_links_ingress:OK #342 tc_links_invalid:OK #343 tc_links_prepend:OK #344 tc_links_replace:OK #345 tc_links_revision:OK Summary: 14/0 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann <[email protected]> Cc: Martin KaFai Lau <[email protected]>
Add a test case which replaces an active ingress qdisc while keeping the miniq in-tact during the transition period to the new clsact qdisc. # ./vmtest.sh -- ./test_progs -t tc_link [...] ./test_progs -t tc_link [ 3.412871] bpf_testmod: loading out-of-tree module taints kernel. [ 3.413343] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel #332 tc_links_after:OK #333 tc_links_append:OK #334 tc_links_basic:OK #335 tc_links_before:OK #336 tc_links_chain_classic:OK #337 tc_links_chain_mixed:OK #338 tc_links_dev_chain0:OK #339 tc_links_dev_cleanup:OK #340 tc_links_dev_mixed:OK #341 tc_links_ingress:OK #342 tc_links_invalid:OK #343 tc_links_prepend:OK #344 tc_links_replace:OK #345 tc_links_revision:OK Summary: 14/0 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann <[email protected]> Cc: Martin KaFai Lau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin KaFai Lau <[email protected]>
Currently, there is no terminator entry for exynosautov920_cmu_of_match, hence facing below KASAN warning, BUG: KASAN: global-out-of-bounds in of_match_node+0x120/0x13c Read of size 1 at addr ffffffe31cc9e628 by task swapper/0/1 CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.11.0+ #334 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x94/0xec show_stack+0x18/0x24 dump_stack_lvl+0x90/0xd0 print_report+0x1f4/0x5b4 kasan_report+0xc8/0x110 __asan_report_load1_noabort+0x20/0x2c of_match_node+0x120/0x13c of_match_device+0x70/0xb4 platform_match+0xa0/0x25c __device_attach_driver+0x7c/0x2d4 bus_for_each_drv+0x100/0x188 __device_attach+0x174/0x364 device_initial_probe+0x14/0x20 bus_probe_device+0x128/0x158 device_add+0xb3c/0x10fc of_device_add+0xdc/0x150 of_platform_device_create_pdata+0x120/0x20c of_platform_bus_create+0x2bc/0x620 of_platform_populate+0x58/0x108 of_platform_default_populate_init+0x100/0x120 do_one_initcall+0x110/0x788 kernel_init_freeable+0x44c/0x61c kernel_init+0x24/0x1e4 ret_from_fork+0x10/0x20 The buggy address belongs to the variable: exynosautov920_cmu_of_match+0xc8/0x2c80 Add a dummy terminator entry at the end to assist of_match_node() in traversing up to the terminator entry without accessing an out-of-boundary index. Fixes: 485e13f ("clk: samsung: add top clock support for ExynosAuto v920 SoC") Signed-off-by: Jinjie Ruan <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] [krzk: drop trailing comma] Signed-off-by: Krzysztof Kozlowski <[email protected]>
Pull request for series with
subject: Introduce local_storage exclusive caching
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=633549