Merge pull request #1 from sched-ext/fix-rusty-eexist

scx_rusty: Work around spurious task_ctx update failures
This commit is contained in:
David Vernet 2023-12-04 11:43:34 -06:00 committed by GitHub
commit d6b978da09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -966,7 +966,13 @@ s32 BPF_STRUCT_OPS(rusty_prep_enable, struct task_struct *p,
pid_t pid;
pid = p->pid;
ret = bpf_map_update_elem(&task_data, &pid, &taskc, BPF_NOEXIST);
/*
* XXX - We want BPF_NOEXIST but bpf_map_delete_elem() in .disable() may
* fail spuriously due to BPF recursion protection triggering
* unnecessarily.
*/
ret = bpf_map_update_elem(&task_data, &pid, &taskc, 0 /*BPF_NOEXIST*/);
if (ret) {
stat_add(RUSTY_STAT_TASK_GET_ERR, 1);
return ret;