Skip to content

Commit e26d83c

Browse files
committed
[scx_lavd] kill unused pick_most_loaded_cpu procedure
Summary: This function was replaced with `pick_cpu_with_lowest_vtime`. Unless there is some other context we plan to use it in, let's get rid of it.
1 parent c36ba4c commit e26d83c

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

scheds/rust/scx_lavd/src/bpf/balance.bpf.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -215,38 +215,6 @@ static int pick_cpu_with_lowest_vtime(struct cpdom_ctx *cpdomc)
215215
return pick_cpu;
216216
}
217217

218-
/*
219-
* For simplicity, try to just steal from the CPU with
220-
* the highest number of queued_tasks in this domain.
221-
*/
222-
static int pick_most_loaded_cpu(struct cpdom_ctx *cpdomc) {
223-
u64 highest_queued = 0;
224-
int pick_cpu = -ENOENT;
225-
int cpu, i, j;
226-
227-
if (!per_cpu_dsq)
228-
return -ENOENT;
229-
230-
bpf_for(i, 0, LAVD_CPU_ID_MAX/64) {
231-
u64 cpumask = cpdomc->__cpumask[i];
232-
bpf_for(j, 0, 64) {
233-
if (cpumask & 0x1LLU << j) {
234-
u64 queued;
235-
cpu = (i * 64) + j;
236-
if (cpu >= __nr_cpu_ids)
237-
break;
238-
queued = scx_bpf_dsq_nr_queued(cpu_to_dsq(cpu));
239-
if (queued > highest_queued) {
240-
highest_queued = queued;
241-
pick_cpu = cpu;
242-
}
243-
}
244-
}
245-
}
246-
247-
return pick_cpu;
248-
}
249-
250218
static bool try_to_steal_task(struct cpdom_ctx *cpdomc)
251219
{
252220
struct cpdom_ctx *cpdomc_pick;

0 commit comments

Comments
 (0)