Merge pull request #891 from etsal/global_costc

scx_layered: point costc to global struct when initializing budgets
This commit is contained in:
Emil Tsalapatis 2024-11-04 21:41:47 +00:00 committed by GitHub
commit 9c6ad33fda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -286,13 +286,13 @@ static void initialize_budgets(u64 refresh_intvl_ns)
layer_weight_sum += layer->weight;
}
costc = initialize_cost(global, global, false, false, false);
if (!costc) {
scx_bpf_error("failed to initialize global budget");
return;
}
bpf_for(layer_id, 0, nr_layers) {
costc = initialize_cost(global, global, false, false, false);
if (!costc) {
scx_bpf_error("failed to initialize global budget");
return;
}
layer = &layers[layer_id];
if (!layer) {
scx_bpf_error("failed to lookup layer %d", layer_id);