Skip to content

Commit e1aa534

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 b41c62c commit e1aa534

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
@@ -213,38 +213,6 @@ static int pick_cpu_with_lowest_vtime(struct cpdom_ctx *cpdomc) {
213213
return pick_cpu;
214214
}
215215

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

0 commit comments

Comments
 (0)