Sched_ext development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Andrea Righi" <arighi@nvidia.com>
Cc: sched-ext@lists.linux.dev
Subject: Re: [PATCH 2/2] selftests/sched_ext: Verify nohz_full tick behavior
Date: Mon, 06 Jul 2026 16:37:53 +0000	[thread overview]
Message-ID: <20260706163754.3C8311F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260706162819.650155-3-arighi@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Worker processes will spin indefinitely if the test terminates abnormally.
--

commit 5f5f7d1cf8a2f7b2edb91658dc637840224ea1dd
Author: Andrea Righi <arighi@nvidia.com>

selftests/sched_ext: Verify nohz_full tick behavior

This commit adds a regression test to validate proper nohz_full behavior in
sched_ext. It verifies that a finite-slice EXT task restarts the periodic
scheduler tick when it follows an infinite-slice task on a NOHZ_FULL CPU.

> diff --git a/tools/testing/selftests/sched_ext/nohz_tick.c b/tools/testing/selftests/sched_ext/nohz_tick.c
> new file mode 100644
> --- /dev/null
> +++ b/tools/testing/selftests/sched_ext/nohz_tick.c

[ ... ]

> +static pid_t start_worker(int cpu)
> +{
> +	struct sched_param param = {};
> +	cpu_set_t mask;
> +	pid_t pid;
> +
> +	pid = fork();
> +	if (pid != 0)
> +		return pid;
> +
> +	/*
> +	 * Become EXT before touching the target so it stays idle until wakeup.
> +	 */
> +	if (sched_setscheduler(0, SCHED_EXT, &param))
> +		_exit(1);
> +
> +	CPU_ZERO(&mask);
> +	CPU_SET(cpu, &mask);
> +	if (sched_setaffinity(0, sizeof(mask), &mask))
> +		_exit(1);
> +
> +	for (;;)
> +		asm volatile("" ::: "memory");

[Severity: Medium]
If the test runner terminates abnormally before reaching stop_worker(), will
this orphaned child process continue to spin indefinitely?

Since the child runs under the SCHED_EXT policy and is pinned to a specific
CPU, an orphaned child would consume 100% of that CPU indefinitely and
potentially interfere with subsequent tests.

Would it be safer to use prctl(PR_SET_PDEATHSIG, SIGKILL) after forking so
the worker is automatically killed if the parent test process exits
unexpectedly?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260706162819.650155-1-arighi@nvidia.com?part=2

  reply	other threads:[~2026-07-06 16:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 16:18 [PATCHSET sched_ext/for-7.2-fixes] sched_ext: Fix finite-slice ticks on nohz_full Andrea Righi
2026-07-06 16:18 ` [PATCH 1/2] sched_ext: Enable tick for finite slices " Andrea Righi
2026-07-06 16:49   ` sashiko-bot
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
2026-07-06 16:37   ` sashiko-bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-07  8:17 [PATCHSET v2 sched_ext/for-7.2-fixes] sched_ext: Fix finite-slice ticks on nohz_full Andrea Righi
2026-07-07  8: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=20260706163754.3C8311F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sched-ext@lists.linux.dev \
    /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