Merge pull request #107 from dschatzberg/fix_affn_viol

scx_layered: Fix AFFN_VIOL stat bump
This commit is contained in:
Tejun Heo 2024-01-26 11:21:07 -10:00 committed by GitHub
commit 4eb2367048
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -404,9 +404,9 @@ s32 BPF_STRUCT_OPS(layered_select_cpu, struct task_struct *p, s32 prev_cpu, u64
/* not much to do if bound to a single CPU */
if (p->nr_cpus_allowed == 1) {
cpu = prev_cpu;
if (!bpf_cpumask_test_cpu(cpu, layer_cpumask))
lstat_inc(LSTAT_AFFN_VIOL, layer, cctx);
if (scx_bpf_test_and_clear_cpu_idle(prev_cpu)) {
if (!bpf_cpumask_test_cpu(cpu, layer_cpumask))
lstat_inc(LSTAT_AFFN_VIOL, layer, cctx);
goto dispatch_local;
} else {
goto out_put_cpumasks;