From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796314210; b=E11FxZAqqVfiyQNSiZ8AHhQTYYzRtQT8ZCBA601VtU6OxbDmvSJ0bkDhq7iYUOMHZwIQ MPkvmQ/1FbVk+YraEzGbocQHWd7DxzKzYfnVsCHgVeghMcEUYtNbMJb0IEFIHhMTcXFk2 lPaZIhFjaOTREhlJl2DjYpGYGbHPlOBkX25J9wFX1dq+SSk1eJKTHH+9yMJDNuC2WR1kM ZrG4D5uuOrqr1Rjpes+Pfyt3SA0gY7gu6XVX6DX6iWvvDSEBzidyCKoDwL0oQYhgkK3dv wjjoUUcBBHx0u0rnFkjKnGRGMOkRT+Cajf3tDTGrJnlUyW1BtesogCLr5kltnMt+5Lw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796314210; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=FR+Jlqj33yJbpKdkNOET0g9vgRM8/3WqqhzoE3/mHCs=; b=jHAlLcrzk+G6oEuv3aJWnfpCyaImOrtfBHIF4A7vuN9lvCsR1ONJcSnnRE7wp/sBSoxQ O8JYjfzwyjURGQQNTWhUyiNINKwoGdBo2+wNarg8bWQCUW4efxzW2c2MhPSsLNXJYqeuK 68ECtGU83N+TPpDwyYDF8EqYlV6AXQejc9nJxya0dfZSIibOsIoznofjAl90wsaO3u+PI 45Vz0OBCmmgI9anmiKANdXQEWDm6nFkGiq0+NhmMzGKz+bFSFvkNrXZDHNMzGHvmgtFJm ITdqhsX7sQDGli0s6xNoV98+eFc+MGuBwbduHb6PmukObZNEVSNFKOeySDNctP4pclg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=K1OR1B6o; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F30E5606A322; Thu, 3 Dec 2026 16:10:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=K1OR1B6o Received: by smtp.kernel.org (Postfix) with ESMTPSA id 464311F000C1; Thu, 3 Dec 2026 16:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796314209; bh=FR+Jlqj33yJbpKdkNOET0g9vgRM8/3WqqhzoE3/mHCs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=K1OR1B6oN6zfxUumuAaxOlkqErN0fqZqcAY0ejeCinX5ofgSSe1rzd06CEsbX0j7L epY1XpY9uYKemHOU2wmaHOBPPMWiCYsttHY11c6ivsKiNxywB3XjjPr4RbDhonUVCX +l+SRAIY+FRxanbXcD7dyYLGjDiBQLbqLuXexOP4J5TwFF4jNMnJja1kXYXXnsqNH9 YD0nyc5fDD4k11whqK8YtXfFI7fDs9zEkL9XSKR0+OHwi1C73VA9hy4I70iuKEB91y byoBxiwdF9NA4ESkBMYsmK9h/UMypDAwF6eFjQEDRiga7JMhaMZ54FokXtZ3dnIXEO mY5tAwH8fyB6A== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v14 14/39] selftests/sched: Test the root domain rebuild in deadline_bw_test Reply-To: sashiko-reviews@lists.linux.dev To: "Mathieu Desnoyers" Cc: linux-rt-devel@lists.linux.dev, tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com, linux-kernel@vger.kernel.org In-Reply-To: <7cc515df44c4d54245ab5c3427cb3a7a3bee04b1.1796296313.git.mathieu.desnoyers@efficios.com> References: <7cc515df44c4d54245ab5c3427cb3a7a3bee04b1.1796296313.git.mathieu.desnoyers@efficios.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 16:10:08 +0000 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [Medium] selftests/sched: new hotplug cases skip ext_switched_all() guard - [Medium] selftests/sched: unchecked probe(NULL) errors and headroom in new cases - [Medium] selftests/sched: hotplug_no_admission_pinned() lacks sysctl restore retry - [Low] selftests/sched: open-coded bandwidth ratio instead of bw_of() -- commit 4704c1b4ece058292b4a960cd1fa4ee1620d2f70 Author: Mathieu Desnoyers selftests/sched: Test the root domain rebuild in deadline_bw_test This commit adds seven test cases to deadline_bw_test covering root domain accounting rebuilds during CPU hotplug, zombie deadline tasks, departed priority-inheritance owners, and sched_setaffinity() racing with sched_setattr(). Link: https://github.com/jlelli/sched-deadline-tests > diff --git a/tools/testing/selftests/sched/deadline/deadline_bw_test.c b/= tools/testing/selftests/sched/deadline/deadline_bw_test.c > index 6ff9da9644030..ba2a18f354d44 100644 > --- a/tools/testing/selftests/sched/deadline/deadline_bw_test.c > +++ b/tools/testing/selftests/sched/deadline/deadline_bw_test.c [ ... ] > +static int hotplug_sleeper_switched(void) > +{ > + int base =3D probe(NULL), base_off, after, cpu, ret =3D KSFT_PASS; > + pid_t pid; > + > + if (cpu_online(hp_cpu, 0)) { > + ksft_print_msg("CPU %d cannot go offline\n", hp_cpu); > + cpu_up(hp_cpu); > + return KSFT_SKIP; > + } > + base_off =3D probe(NULL); [Severity: Medium] Can unchecked probe(NULL) errors cause false passes or wrong skips here? probe(NULL) returns -1 on internal failure, such as disabled admission control hitting the thread limit. Because hotplug_sleeper_switched(), hotplug_no_admission_pinned(), and affinity_vs_setattr() never check for < 0, repeated -1 returns compare equal and report KSFT_PASS. In hotplug_sleepers() and hotplug_departed(), a -1 return falls into the insufficient-room check and reports KSFT_SKIP instead of KSFT_FAIL. Separately, hotplug_sleeper_switched() omits a base_off < 3 check for its 30% sleeper, and hotplug_departed() checks base_off <=3D 0 instead of base_off < 4 for its 40% task. On a tight sched_rt_runtime_us, cpu_online(..., 0) can return -EBUSY and fail instead of skipping. [ ... ] > +out: > + cpu_up(hp_cpu); > + reap(pid); > + if (write_file("/proc/sys/kernel", "sched_rt_runtime_us", saved)) { > + ksft_print_msg("admission control cannot be turned on again\n"); > + return KSFT_FAIL; > + } > + sleep_ns(3 * PERIOD); [Severity: Medium] What happens if restoring sched_rt_runtime_us fails with -EBUSY before the killed 50% task reaches its 0-lag time? When free headroom is under 50% (or cpu_up(hp_cpu) fails), sched_dl_global_validate() rejects the write because dl_b->total_bw still counts the departing task, and sched_rt_handler() rolls sched_rt_runtime_us back to -1. Because hotplug_no_admission_pinned() returns immediately without sleeping 3 * PERIOD or polling with wait_for() as server_restore() does, admission control stays permanently at -1 for the rest of hp_cases[] and on the host after the test exits. [ ... ] > + bw =3D (ZOMBIE_RUNTIME << 20) / ZOMBIE_PERIOD; /* as to_ratio() */ [Severity: Low] This isn't a bug, but both death_zombie_hotplug() and pi_departed_moved() open-code this ratio instead of reusing the existing bw_of(ZOMBIE_RUNTIME, ZOMBIE_PERIOD) helper. [ ... ] > @@ -4790,6 +5429,7 @@ static const struct p_case { > { "death_pi_deadline_owner", death_pi_deadline_owner, MEASURED_IN_P }, > { "death_group", death_group, MEASURED_IN_P }, > { "death_zombie_switched", death_zombie_switched, FROM_OUTSIDE }, > + { "death_zombie_hotplug", death_zombie_hotplug, FROM_OUTSIDE }, > { "yield_switched_out", yield_switched_out, IN_P }, > { "yield_killed", yield_killed, MEASURED_IN_P }, > { "overrun_caught", overrun_caught, IN_P }, > @@ -4808,9 +5448,15 @@ static const struct p_case { > static const struct hp_case { > const char *name; > int (*fn)(void); > + int no_hp; /* takes no CPU offline */ > } hp_cases[] =3D { > + { "hotplug_sleepers", hotplug_sleepers }, > + { "hotplug_sleeper_switched", hotplug_sleeper_switched }, > + { "hotplug_no_admission_pinned", hotplug_no_admission_pinned }, > { "hotplug_refused", hotplug_refused }, > + { "hotplug_departed", hotplug_departed }, > { "hotplug_server", hotplug_server }, > + { "affinity_vs_setattr", affinity_vs_setattr, 1 }, > }; [Severity: Medium] Should death_zombie_hotplug() and the four new hotplug cases in hp_cases[] skip when ext_switched_all() is true, as hotplug_server() does? With a full-mode sched_ext scheduler lacking ops.cpu_offline, offlining a CPU exits the scheduler in handle_hotplug() and detaches ext_server in favor of fair_server. Because server_init() latches server_dir to ext_server once at startup, the later server_* cases in p_cases[] (and hotplug_server(), whose own ext_switched_all() guard then returns 0) write to the detached ext_server and fail. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796296313.gi= t.mathieu.desnoyers@efficios.com?part=3D14