From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>
Cc: Joel Fernandes <joelagnelf@nvidia.com>,
sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCHSET sched_ext/for-7.2-fixes] sched_ext: Fix finite-slice ticks on nohz_full
Date: Mon, 6 Jul 2026 18:18:20 +0200 [thread overview]
Message-ID: <20260706162819.650155-1-arighi@nvidia.com> (raw)
When an EXT task with a finite slice is scheduled on a nohz_full CPU, the
scheduler may incorrectly keep the tick disabled because it still observes the
outgoing task (e.g., the idle task) during the context switch. As a result, the
incoming task can run past its assigned slice.
Fix this by always enabling the scheduler tick for finite-slice EXT tasks and
provide a kselftest that reproduces the scenario and verifies that scheduler
ticks are delivered correctly. Test is skipped in kernels without available
nohz_full CPUS.
Test case (using virtme-ng):
$ vng -vb --config tools/testing/selftests/sched_ext/config \
--configitem CONFIG_NO_HZ_FULL=y
$ vng --append "nohz_full=all" -- \
tools/testing/selftests/sched_ext/runner -t nohz_tick
Before:
$ vng --append "nohz_full=all" -- tools/testing/selftests/sched_ext/runner -t nohz_tick
===== START =====
TEST: nohz_tick
DESCRIPTION: Verify finite EXT slices restart the NOHZ_FULL tick
OUTPUT:
ERR: nohz_tick.c:270
Finite-slice worker received only 1 scheduler ticks
not ok 1 nohz_tick #
===== END =====
=============================
RESULTS:
PASSED: 0
SKIPPED: 0
FAILED: 1
Failed tests:
- nohz_tick
After:
$ vng --append "nohz_full=all" -- tools/testing/selftests/sched_ext/runner -t nohz_tick
===== START =====
TEST: nohz_tick
DESCRIPTION: Verify finite EXT slices restart the NOHZ_FULL tick
OUTPUT:
CPU 1 received 4 finite-slice ticks
ok 1 nohz_tick #
===== END =====
=============================
RESULTS:
PASSED: 1
SKIPPED: 0
FAILED: 0
Andrea Righi (2):
sched_ext: Enable tick for finite slices on nohz_full
selftests/sched_ext: Verify nohz_full tick behavior
kernel/sched/ext/ext.c | 14 +-
tools/testing/selftests/sched_ext/Makefile | 1 +
tools/testing/selftests/sched_ext/nohz_tick.bpf.c | 65 +++++
tools/testing/selftests/sched_ext/nohz_tick.c | 309 ++++++++++++++++++++++
4 files changed, 386 insertions(+), 3 deletions(-)
next reply other threads:[~2026-07-06 16:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 16:18 Andrea Righi [this message]
2026-07-06 16:18 ` [PATCH 1/2] sched_ext: Enable tick for finite slices on nohz_full Andrea Righi
2026-07-06 22:09 ` Tejun Heo
2026-07-07 5:52 ` Andrea Righi
2026-07-06 16:18 ` [PATCH 2/2] selftests/sched_ext: Verify nohz_full tick behavior Andrea Righi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260706162819.650155-1-arighi@nvidia.com \
--to=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=joelagnelf@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox