All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH sched_ext/for-7.2-fixes] sched_ext: Convert scx_arena_grow() to use scx_arena_to_kaddr()
@ 2026-06-25 15:13 Cheng-Yang Chou
  2026-06-25 20:28 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Cheng-Yang Chou @ 2026-06-25 15:13 UTC (permalink / raw)
  To: sched-ext, Tejun Heo, David Vernet, Andrea Righi, Changwoo Min
  Cc: Ching-Chun Huang, Chia-Ping Tsai, chengyang.chou, Cheng-Yang Chou

scx_arena_grow() was left open-coded when 2e05f2fd0dd7 ("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>
---
 kernel/sched/ext/arena.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/kernel/sched/ext/arena.c b/kernel/sched/ext/arena.c
index 5783694ec21d..b0e6a0be4913 100644
--- a/kernel/sched/ext/arena.c
+++ b/kernel/sched/ext/arena.c
@@ -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);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH sched_ext/for-7.2-fixes] sched_ext: Convert scx_arena_grow() to use scx_arena_to_kaddr()
  2026-06-25 15:13 [PATCH sched_ext/for-7.2-fixes] sched_ext: Convert scx_arena_grow() to use scx_arena_to_kaddr() Cheng-Yang Chou
@ 2026-06-25 20:28 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2026-06-25 20:28 UTC (permalink / raw)
  To: Cheng-Yang Chou
  Cc: sched-ext, David Vernet, Andrea Righi, Changwoo Min,
	Ching-Chun Huang, Chia-Ping Tsai, chengyang.chou

Hello,

On Thu, Jun 25, 2026 at 11:13:11PM +0800, Cheng-Yang Chou wrote:
> scx_arena_grow() was left open-coded when 2e05f2fd0dd7 ("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).

Applied to sched_ext/for-7.3.

Thanks.

--
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-25 20:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-25 15:13 [PATCH sched_ext/for-7.2-fixes] sched_ext: Convert scx_arena_grow() to use scx_arena_to_kaddr() Cheng-Yang Chou
2026-06-25 20:28 ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.