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: Do not set task's time slice to zero at the ops.enqueue() path #1284

Merged
merged 2 commits into from
Feb 1, 2025

Conversation

multics69
Copy link
Contributor

Note that at ops.enqueue() path, setting a task's slice to zero is risky because we don't know the exact status of the task, so it could cause a zero time slice error as follows:

[ 8271.001818] sched_ext: ksoftirqd/1[70] has zero slice in pick_task_scx()

The zero slice warning is harmful because the sched_ext core ends up setting the time slice to SCX_SLICE_DFL (20 msec), increasing latency spikes.

Thus, we do not set the time slice to 0 at the ops.enqueue() path and rely on scx_bpf_kick_cpu(SCX_KICK_PREEMPT) all the time. Also, use 1 (instead of 0) as a marker to perform scx_bpf_kick_cpu().

This should solve the following issue:

#1283

Note that at ops.enqueue() path, setting a task's slice to zero is risky
because we don't know the exact status of the task, so it could cause a
zero time slice error as follows:

   [ 8271.001818] sched_ext: ksoftirqd/1[70] has zero slice in pick_task_scx()

The zero slice warning is harmful because the sched_ext core ends up
setting the time slice to SCX_SLICE_DFL (20 msec), increasing latency spikes.

Thus, we do not set the time slice to 0 at the ops.enqueue() path and rely
on scx_bpf_kick_cpu(SCX_KICK_PREEMPT) all the time. Also, use 1 (instead of 0)
as a marker to perform scx_bpf_kick_cpu().

This should solve the following issue:

   sched-ext#1283

Signed-off-by: Changwoo Min <changwoo@igalia.com>
Separate setting the preemption information into the case of entering into
an idle state and the case that the CPU is taken by a high scheduling class.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
@multics69 multics69 added this pull request to the merge queue Feb 1, 2025
Merged via the queue into sched-ext:main with commit 234d50d Feb 1, 2025
24 checks passed
@multics69 multics69 deleted the lavd-zero-slice branch February 1, 2025 16:24
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.

1 participant