Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tools/sched_ext/include: Sync bpf_arena_common.bpf.h with scx repo

Sync the following changes from the scx repo:

- Guard __arena define with #ifndef to avoid redefinition when the
attribute is already defined by another header.
- Add bpf_arena_reserve_pages() and bpf_arena_mapping_nr_pages() ksym
declarations.
- Rename TEST to SCX_BPF_UNITTEST to avoid collision with generic TEST
macros in other projects.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Andrea Righi <arighi@nvidia.com>

Tejun Heo 9c6437f7 c90af06c

+6 -2
+6 -2
tools/sched_ext/include/scx/bpf_arena_common.bpf.h
··· 15 15 #endif 16 16 17 17 #if defined(__BPF_FEATURE_ADDR_SPACE_CAST) && !defined(BPF_ARENA_FORCE_ASM) 18 + #ifndef __arena 18 19 #define __arena __attribute__((address_space(1))) 20 + #endif 19 21 #define __arena_global __attribute__((address_space(1))) 20 22 #define cast_kern(ptr) /* nop for bpf prog. emitted by LLVM */ 21 23 #define cast_user(ptr) /* nop for bpf prog. emitted by LLVM */ ··· 83 81 void __arena* bpf_arena_alloc_pages(void *map, void __arena *addr, __u32 page_cnt, 84 82 int node_id, __u64 flags) __ksym __weak; 85 83 void bpf_arena_free_pages(void *map, void __arena *ptr, __u32 page_cnt) __ksym __weak; 84 + int bpf_arena_reserve_pages(void *map, void __arena *ptr, __u32 page_cnt) __ksym __weak; 86 85 87 86 /* 88 87 * Note that cond_break can only be portably used in the body of a breakable 89 88 * construct, whereas can_loop can be used anywhere. 90 89 */ 91 - #ifdef TEST 90 + #ifdef SCX_BPF_UNITTEST 92 91 #define can_loop true 93 92 #define __cond_break(expr) expr 94 93 #else ··· 168 165 }) 169 166 #endif /* __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ */ 170 167 #endif /* __BPF_FEATURE_MAY_GOTO */ 171 - #endif /* TEST */ 168 + #endif /* SCX_BPF_UNITTEST */ 172 169 173 170 #define cond_break __cond_break(break) 174 171 #define cond_break_label(label) __cond_break(goto label) ··· 176 173 177 174 void bpf_preempt_disable(void) __weak __ksym; 178 175 void bpf_preempt_enable(void) __weak __ksym; 176 + ssize_t bpf_arena_mapping_nr_pages(void *p__map) __weak __ksym;