mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
sched_ext: Convert scx_arena_grow() to use scx_arena_to_kaddr()
scx_arena_grow() was left open-coded when 2e05f2fd0d ("sched_ext: Add
scx_arena_to_kaddr() / scx_kaddr_to_arena()") introduced the helper.
Replace the manual bpf_arena_map_kern_vm_start() fetch and #ifdef guard
with scx_arena_to_kaddr(sch, p).
Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
committed by
Tejun Heo
parent
252891d03d
commit
e2c60e15d0
@@ -70,8 +70,6 @@ void scx_arena_pool_destroy(struct scx_sched *sch)
|
||||
*/
|
||||
static int scx_arena_grow(struct scx_sched *sch, u32 page_cnt)
|
||||
{
|
||||
u64 kern_vm_start;
|
||||
u32 uaddr32;
|
||||
void *p;
|
||||
int ret;
|
||||
|
||||
@@ -83,15 +81,8 @@ static int scx_arena_grow(struct scx_sched *sch, u32 page_cnt)
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
uaddr32 = (u32)(unsigned long)p;
|
||||
/* arena.o, which defines these, is built only on MMU && 64BIT */
|
||||
#if defined(CONFIG_MMU) && defined(CONFIG_64BIT)
|
||||
kern_vm_start = bpf_arena_map_kern_vm_start(sch->arena_map);
|
||||
#else
|
||||
kern_vm_start = 0;
|
||||
#endif
|
||||
|
||||
ret = gen_pool_add(sch->arena_pool, kern_vm_start + uaddr32,
|
||||
ret = gen_pool_add(sch->arena_pool,
|
||||
(unsigned long)scx_arena_to_kaddr(sch, p),
|
||||
page_cnt * PAGE_SIZE, NUMA_NO_NODE);
|
||||
if (ret) {
|
||||
bpf_arena_free_pages_non_sleepable(sch->arena_map, p, page_cnt);
|
||||
|
||||
Reference in New Issue
Block a user