Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scx_lavd: always inline submit_task_ctx to make the verifier happy #247

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

multics69
Copy link
Contributor

In some kernel versions, loading scx_lavd fails with an error of "bpf_rcu_read_unlock is missing". The usage of
bpf_rcu_read_lock/unlock() in proc_dump_all_tasks() is correct but the bpf verifier still think bpf_rcu_read_unlock() is missing. The most plausible reason so far is that the problematic kernel does not have a commit 6fceea0fa59f ("bpf: Transfer RCU lock state between subprog calls"), failing inter-procedural analysis between proc_dump_all_tasks() and
submit_task_ctx(). Thus, we force inline submit_task_ctx() (no inter-procedural analysis by the verifier is necessary) for the time being.

Suggested-by: Tejun Heo tj@kernel.org

In _some_ kernel versions, loading scx_lavd fails with an error of
"bpf_rcu_read_unlock is missing". The usage of
bpf_rcu_read_lock/unlock() in proc_dump_all_tasks() is correct but the
bpf verifier still think bpf_rcu_read_unlock() is missing. The most
plausible reason so far is that the problematic kernel does not have a
commit 6fceea0fa59f ("bpf: Transfer RCU lock state between subprog
calls"), failing inter-procedural analysis between proc_dump_all_tasks()
and submit_task_ctx(). Thus, we force inline submit_task_ctx() (no
inter-procedural analysis by the verifier is necessary) for the time
being.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Changwoo Min <changwoo@igalia.com>
@multics69 multics69 requested a review from htejun April 27, 2024 15:28
@htejun htejun merged commit 5b7b7d5 into sched-ext:main Apr 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants