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_layered: Put all tasks with custom affinities into the hi fallbak DSQs #1064

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion scheds/rust/scx_layered/src/bpf/main.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,15 @@ void BPF_STRUCT_OPS(layered_enqueue, struct task_struct *p, u64 enq_flags)
* regardless of its cpumask. However, a task with custom cpumask in a
* confined layer may fail to be consumed for an indefinite amount of
* time. Queue them to the fallback DSQ.
*
* XXX - An open or grouped layer is no longer always consumed from all
* CPUs as owned protection can make a CPU execute only the owning
* layer. For now, throw all tasks with custom affinities to hi fallback
* DSQs. Later, implement starvation prevention for lo fallback DSQs and
* put them there. Also, this should become node aware so that
* node-affine tasks aren't thrown into the fallback DSQs.
*/
if (layer->kind == LAYER_KIND_CONFINED && !taskc->all_cpus_allowed) {
if (/*layer->kind == LAYER_KIND_CONFINED && */!taskc->all_cpus_allowed) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this maybe should have been || in the first place I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think && was correct. Open/grouped didn't have to go to hi fallback DSQs, only the confined layer tasks needed to do which is &&.

lstat_inc(LSTAT_AFFN_VIOL, layer, cpuc);
/*
* We were previously dispatching to LO_FALLBACK_DSQ for any
Expand Down
Loading