public inbox for linux-kselftest@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: zhidao su <soolaugust@gmail.com>
Cc: sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, void@manifault.com,
	arighi@nvidia.com, changwoo@igalia.com, peterz@infradead.org,
	mingo@redhat.com, shuah@kernel.org,
	zhidao su <suzhidao@xiaomi.com>
Subject: Re: [PATCH 2/2] selftests/sched_ext: Add failure-path tests for sub-sched
Date: Sun, 22 Mar 2026 21:23:19 -1000	[thread overview]
Message-ID: <acDqZ1PTcksLXiom@slm.duckdns.org> (raw)
In-Reply-To: <20260323061832.2743315-2-suzhidao@xiaomi.com>

On Mon, Mar 23, 2026 at 02:18:32PM +0800, zhidao su wrote:
> Sub-sched error paths have historically been fragile: a cgroup
> double-put bug and an uninitialized return value were both found in
> the abort path but not caught by automated tests because only the
> happy path was covered.
> 
> Add three tests targeting specific failure scenarios:
> 
> 1. sub_sched_parent_reject: Tests the sub_attach rejection path.
>    A parent scheduler returning -EPERM forces the kernel to execute
>    the abort path (ext.c abort label), which must correctly clean up
>    partially-initialized tasks and SCX_TASK_SUB_INIT flags. This is
>    the path where commit 0c66b0da0064 ("sched_ext: Fix cgroup
>    double-put on sub-sched abort path") and commit e36bc38ebfac
>    ("sched_ext: Fix uninitialized ret in scx_alloc_and_add_sched()")
>    occurred.
> 
> 2. sub_sched_nesting: Tests cascading disable through a 3-level
>    scheduler hierarchy (root -> level1 -> level2). When schedulers
>    are detached in reverse order, drain_descendants() must recursively
>    wait for all children to complete their disable sequence without
>    deadlock or resource leaks.
> 
> 3. sub_sched_race: Tests concurrent race between parent disable and
>    child enable. A background thread destroys the parent link while
>    the main thread attaches the child, exercising synchronization
>    between scx_sub_enable_workfn() and the parent disable path.
> 
> All three tests create cgroups under /sys/fs/cgroup/ and are verified
> to pass on a kernel with sub-sched support enabled.

Let's hold off on sub-sched tests for now. It's a bit too early.

Thanks.

-- 
tejun

      reply	other threads:[~2026-03-23  7:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23  6:18 [PATCH 1/2] selftests/sched_ext: Add basic sub-sched functionality test zhidao su
2026-03-23  6:18 ` [PATCH 2/2] selftests/sched_ext: Add failure-path tests for sub-sched zhidao su
2026-03-23  7:23   ` Tejun Heo [this message]

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=acDqZ1PTcksLXiom@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=shuah@kernel.org \
    --cc=soolaugust@gmail.com \
    --cc=suzhidao@xiaomi.com \
    --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