scx_layered: Fix error in dispatch consumption

Fix bug is consume_non_open where it improperly returns 0 when the DSQ
is not consumed.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
This commit is contained in:
Daniel Hodges 2024-11-11 08:17:25 -08:00
parent 38512bfce8
commit 1ed387d7f3
2 changed files with 2 additions and 2 deletions

View File

@ -280,7 +280,7 @@ int record_cpu_cost(struct cost *costc, u32 budget_id, s64 amount)
/*
* Returns the slice_ns of a layer if there is appropriate budget.
*/
int has_budget(struct cost *costc, struct layer *layer)
__weak int has_budget(struct cost *costc, struct layer *layer)
{
if (!layer || !costc) {
scx_bpf_error("can't happen");

View File

@ -1392,7 +1392,7 @@ __weak int consume_non_open(struct cost *costc, s32 cpu, u32 my_llc_id)
struct cpumask *layer_cpumask;
if (!(layer_cpumask = lookup_layer_cpumask(layer_idx)))
return 0;
return -ENOENT;
if (!bpf_cpumask_test_cpu(cpu, layer_cpumask) &&
(cpu > nr_possible_cpus || cpu != fallback_cpu || layer->nr_cpus != 0))
continue;