Skip to contentSkip to conversation

tools/sched_ext: Remove unused nr_cpus in scx_cpu0

PATCH Applied Cheng-Yang Chou 2 participants 2 messages Apr 21 Scheduler - sched_ext

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/sched_ext: Remove unused nr_cpus in scx_cpu0

The nr_cpus variable is defined in scx_cpu0.bpf.c but never used in the BPF logic. Remove both in BPF and userspace side.

---
 tools/sched_ext/scx_cpu0.bpf.c | 2 --
 tools/sched_ext/scx_cpu0.c     | 2 --
 2 files changed, 4 deletions(-)
tools/sched_ext/scx_cpu0.bpf.c +0 -2
index 0b1a7ce879b0..909d1be1bfe3 100644
@@ -18,8 +18,6 @@
 
 char _license[] SEC("license") = "GPL";
 
-const volatile u32 nr_cpus = 32;	/* !0 for veristat, set during init */
-
 UEI_DEFINE(uei);
 
 /*
tools/sched_ext/scx_cpu0.c +0 -2
index a6fba9978b9c..4966e3d4c724 100644
@@ -72,8 +72,6 @@ int main(int argc, char **argv)
 	optind = 1;
 	skel = SCX_OPS_OPEN(cpu0_ops, scx_cpu0);
 
-	skel->rodata->nr_cpus = libbpf_num_possible_cpus();
-
 	while ((opt = getopt(argc, argv, "vh")) != -1) {
 		switch (opt) {
 		case 'v':
Signature · 1 line
2.48.1
reviewer Applied
#1 lore raw

Hello,

Quoted 2 lines · Cheng-Yang Chou

The nr_cpus variable is defined in scx_cpu0.bpf.c but never used in the BPF logic. Remove both in BPF and userspace side.

Applied to sched_ext/for-7.2.

Thanks.

--
tejun