From 2ee07bb1fb785b09e9f4bf6cef73348b103dd773 Mon Sep 17 00:00:00 2001 From: Andrea Righi Date: Mon, 26 Aug 2024 15:53:06 +0200 Subject: [PATCH] scx_rustland_core: temporarily drop RL_PREEMPT_CPU Temporarily drop the RL_PREEMPT_CPU flag, we need a better way to implement preemption in scx_rustland_core and it's not very effective at the moment, so simply it drop it for now (it'll be re-added later in the future in a proper way). This change does not affect any scheduler, since RL_PREEMPT_CPU is currently unused. Signed-off-by: Andrea Righi --- rust/scx_rustland_core/assets/bpf.rs | 4 ---- rust/scx_rustland_core/assets/bpf/intf.h | 5 ----- rust/scx_rustland_core/assets/bpf/main.bpf.c | 7 +------ 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/rust/scx_rustland_core/assets/bpf.rs b/rust/scx_rustland_core/assets/bpf.rs index 7f0995b..a1bc85a 100644 --- a/rust/scx_rustland_core/assets/bpf.rs +++ b/rust/scx_rustland_core/assets/bpf.rs @@ -53,10 +53,6 @@ const SCHED_EXT: i32 = 7; #[allow(dead_code)] pub const RL_CPU_ANY: u64 = bpf_intf::RL_CPU_ANY as u64; -// Allow to preempt the target CPU when dispatching the task. -#[allow(dead_code)] -pub const RL_PREEMPT_CPU: u64 = bpf_intf::RL_PREEMPT_CPU as u64; - /// High-level Rust abstraction to interact with a generic sched-ext BPF component. /// /// Overview diff --git a/rust/scx_rustland_core/assets/bpf/intf.h b/rust/scx_rustland_core/assets/bpf/intf.h index 49b2928..203e987 100644 --- a/rust/scx_rustland_core/assets/bpf/intf.h +++ b/rust/scx_rustland_core/assets/bpf/intf.h @@ -54,11 +54,6 @@ enum { * on the first CPU available. */ RL_CPU_ANY = 1 << 0, - - /* - * Allow to preempt the target CPU when dispatching the task. - */ - RL_PREEMPT_CPU = 1 << 1, }; /* diff --git a/rust/scx_rustland_core/assets/bpf/main.bpf.c b/rust/scx_rustland_core/assets/bpf/main.bpf.c index c52dfec..6ce30a5 100644 --- a/rust/scx_rustland_core/assets/bpf/main.bpf.c +++ b/rust/scx_rustland_core/assets/bpf/main.bpf.c @@ -683,12 +683,7 @@ static long handle_dispatched_task(struct bpf_dynptr *dynptr, void *context) dbg_msg("usersched: pid=%d cpu=%d cpumask_cnt=%llu slice_ns=%llu flags=%llx", task->pid, task->cpu, task->cpumask_cnt, task->slice_ns, task->flags); - /* - * Map RL_PREEMPT_CPU to SCX_ENQ_PREEMPT and allow this task to - * preempt others. - */ - if (task->flags & RL_PREEMPT_CPU) - enq_flags = SCX_ENQ_PREEMPT; + /* * Check whether the user-space scheduler assigned a different * CPU to the task and migrate (if possible).