mirror of
https://github.com/sched-ext/scx.git
synced 2024-11-24 20:00:22 +00:00
04685e633f
Instead of using a BPF_MAP_TYPE_ARRAY to store which tasks are running on which CPU we can simply use a global array, mapped in the user-space address space. In this way we can avoid a lot of memory copies and call to sys_bpf(), significantly reducing the scheduler's overhead. Keep in mind that we don't need to be 100% correct while accessing this information, so we can accept some fuzziness in order to significantly reduce the scheduler's overhead. Performance profile before this change: 5.52% [kernel] [k] __sys_bpf 4.84% [kernel] [k] __kmem_cache_alloc_node 4.71% [kernel] [k] map_lookup_elem 4.10% [kernel] [k] _copy_from_user 3.51% [kernel] [k] bpf_map_copy_value 3.12% [kernel] [k] check_heap_object After this change: 2.20% [kernel] [k] __sys_bpf 1.91% [kernel] [k] map_lookup_and_delete_elem 1.60% [kernel] [k] __kmem_cache_alloc_node 1.10% [kernel] [k] _copy_from_user 0.12% [kernel] [k] check_heap_object n/a bpf_map_copy_value n/a map_lookup_elem With this change we can reduce the overhead of sys_bpf() by ~2x and the overhead of copy_from_user() by ~4x. Signed-off-by: Andrea Righi <andrea.righi@canonical.com> |
||
---|---|---|
.. | ||
scx_layered | ||
scx_rustland | ||
scx_rusty | ||
meson.build | ||
README.md |
RUST SCHEDULERS
Introduction
This directory contains schedulers with user space rust components.
The README in each scheduler directory provides some background and describes the types of workloads or scenarios they're designed to accommodate. For more details on any of these schedulers, please see the header comment in their main.rs or *.bpf.c files.