* [PATCH 0/2] selftests/cgroup: Fix cpuset test portability and hotplug error handling
@ 2026-08-09 8:21 Rui Qi
2026-08-09 8:21 ` [PATCH 1/2] selftests/cgroup: Avoid awk -e in cpuset tests Rui Qi
2026-08-09 8:21 ` [PATCH 2/2] selftests/cgroup: Preserve CPU hotplug write errors Rui Qi
0 siblings, 2 replies; 9+ messages in thread
From: Rui Qi @ 2026-08-09 8:21 UTC (permalink / raw)
To: Tejun Heo
Cc: Waiman Long, Ridong Chen, Johannes Weiner, Michal Koutný,
Shuah Khan, cgroups, linux-kselftest, linux-kernel, Rui Qi
Hi,
This series fixes two cpuset selftest issues.
Patch 1 removes awk -e from cpuset selftests. The option is accepted by
gawk, but rejected by mawk, causing mount point detection to fail on
systems where awk is provided by mawk.
Patch 2 preserves CPU hotplug write failures in test_cpuset_prs.sh. The
helper currently returns the status of pause after the write, hiding the
write failure from callers. Moving the write before the bookkeeping also
keeps OFFLINE_CPUS aligned with hotplug operations that actually
succeeded.
Testing:
- git apply --check the two patches in this series
- scripts/checkpatch.pl --strict on each patch
- bash -n tools/testing/selftests/cgroup/test_cpuset_prs.sh
- bash -n tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh
- mawk 'BEGIN {print 1}'
The full cpuset hotplug selftests were not run because they offline and
online CPUs.
Rui Qi (2):
selftests/cgroup: Avoid awk -e in cpuset tests
selftests/cgroup: Preserve CPU hotplug write errors
tools/testing/selftests/cgroup/test_cpuset_prs.sh | 5 +++--
tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 1/2] selftests/cgroup: Avoid awk -e in cpuset tests 2026-08-09 8:21 [PATCH 0/2] selftests/cgroup: Fix cpuset test portability and hotplug error handling Rui Qi @ 2026-08-09 8:21 ` Rui Qi 2026-08-10 3:07 ` Ridong Chen ` (2 more replies) 2026-08-09 8:21 ` [PATCH 2/2] selftests/cgroup: Preserve CPU hotplug write errors Rui Qi 1 sibling, 3 replies; 9+ messages in thread From: Rui Qi @ 2026-08-09 8:21 UTC (permalink / raw) To: Tejun Heo Cc: Waiman Long, Ridong Chen, Johannes Weiner, Michal Koutný, Shuah Khan, cgroups, linux-kselftest, linux-kernel, Rui Qi The cpuset selftests use awk -e to parse cgroup mount points. This works with gawk, but mawk rejects the option. In test_cpuset_prs.sh, this leaves CGROUP2 empty and causes the test to skip as if cgroup v2 were not mounted. The same non-portable invocation exists in the cpuset v1 hotplug test. The scripts only need to pass a single awk program. Use the standard awk invocation without -e so mount point detection works with awk implementations that do not support the gawk extension. Fixes: a8c52eba880a ("kselftest/cgroup: Add cpuset v2 partition root state test") Fixes: 812c5945bdb8 ("cgroup/cpuset: Add test_cpuset_v1_hp.sh") Signed-off-by: Rui Qi <qirui.001@bytedance.com> --- tools/testing/selftests/cgroup/test_cpuset_prs.sh | 2 +- tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh index 400a696a0d21..16c38eb11e63 100755 --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh @@ -20,7 +20,7 @@ skip_test() { WAIT_INOTIFY=$(cd $(dirname $0); pwd)/wait_inotify # Find cgroup v2 mount point -CGROUP2=$(mount -t cgroup2 | head -1 | awk -e '{print $3}') +CGROUP2=$(mount -t cgroup2 | head -1 | awk '{print $3}') [[ -n "$CGROUP2" ]] || skip_test "Cgroup v2 mount point not found!" SUBPARTS_CPUS=$CGROUP2/.__DEBUG__.cpuset.cpus.subpartitions CPULIST=$(cat $CGROUP2/cpuset.cpus.effective) diff --git a/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh b/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh index 7406c24be1ac..da97f1643f9a 100755 --- a/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh +++ b/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh @@ -14,7 +14,7 @@ skip_test() { [[ $(id -u) -eq 0 ]] || skip_test "Test must be run as root!" # Find cpuset v1 mount point -CPUSET=$(mount -t cgroup | grep cpuset | head -1 | awk -e '{print $3}') +CPUSET=$(mount -t cgroup | grep cpuset | head -1 | awk '{print $3}') [[ -n "$CPUSET" ]] || skip_test "cpuset v1 mount point not found!" # -- 2.20.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] selftests/cgroup: Avoid awk -e in cpuset tests 2026-08-09 8:21 ` [PATCH 1/2] selftests/cgroup: Avoid awk -e in cpuset tests Rui Qi @ 2026-08-10 3:07 ` Ridong Chen 2026-08-10 14:49 ` Waiman Long 2026-08-10 19:36 ` Tejun Heo 2 siblings, 0 replies; 9+ messages in thread From: Ridong Chen @ 2026-08-10 3:07 UTC (permalink / raw) To: Rui Qi, Tejun Heo Cc: Waiman Long, Johannes Weiner, Michal Koutný, Shuah Khan, cgroups, linux-kselftest, linux-kernel On 8/9/2026 4:21 PM, Rui Qi wrote: > The cpuset selftests use awk -e to parse cgroup mount points. This > works with gawk, but mawk rejects the option. In test_cpuset_prs.sh, > this leaves CGROUP2 empty and causes the test to skip as if cgroup v2 > were not mounted. The same non-portable invocation exists in the cpuset > v1 hotplug test. > > The scripts only need to pass a single awk program. Use the standard awk > invocation without -e so mount point detection works with awk > implementations that do not support the gawk extension. > > Fixes: a8c52eba880a ("kselftest/cgroup: Add cpuset v2 partition root state test") > Fixes: 812c5945bdb8 ("cgroup/cpuset: Add test_cpuset_v1_hp.sh") > Signed-off-by: Rui Qi <qirui.001@bytedance.com> > --- > tools/testing/selftests/cgroup/test_cpuset_prs.sh | 2 +- > tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > index 400a696a0d21..16c38eb11e63 100755 > --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh > +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > @@ -20,7 +20,7 @@ skip_test() { > WAIT_INOTIFY=$(cd $(dirname $0); pwd)/wait_inotify > > # Find cgroup v2 mount point > -CGROUP2=$(mount -t cgroup2 | head -1 | awk -e '{print $3}') > +CGROUP2=$(mount -t cgroup2 | head -1 | awk '{print $3}') > [[ -n "$CGROUP2" ]] || skip_test "Cgroup v2 mount point not found!" > SUBPARTS_CPUS=$CGROUP2/.__DEBUG__.cpuset.cpus.subpartitions > CPULIST=$(cat $CGROUP2/cpuset.cpus.effective) > diff --git a/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh b/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh > index 7406c24be1ac..da97f1643f9a 100755 > --- a/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh > +++ b/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh > @@ -14,7 +14,7 @@ skip_test() { > [[ $(id -u) -eq 0 ]] || skip_test "Test must be run as root!" > > # Find cpuset v1 mount point > -CPUSET=$(mount -t cgroup | grep cpuset | head -1 | awk -e '{print $3}') > +CPUSET=$(mount -t cgroup | grep cpuset | head -1 | awk '{print $3}') > [[ -n "$CPUSET" ]] || skip_test "cpuset v1 mount point not found!" > > # Looks good to me. Reviewed-by: Ridong Chen <ridong.chen@linux.dev> -- Best regards Ridong ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] selftests/cgroup: Avoid awk -e in cpuset tests 2026-08-09 8:21 ` [PATCH 1/2] selftests/cgroup: Avoid awk -e in cpuset tests Rui Qi 2026-08-10 3:07 ` Ridong Chen @ 2026-08-10 14:49 ` Waiman Long 2026-08-10 19:36 ` Tejun Heo 2 siblings, 0 replies; 9+ messages in thread From: Waiman Long @ 2026-08-10 14:49 UTC (permalink / raw) To: Rui Qi, Tejun Heo Cc: Ridong Chen, Johannes Weiner, Michal Koutný, Shuah Khan, cgroups, linux-kselftest, linux-kernel On 8/9/26 4:21 AM, Rui Qi wrote: > The cpuset selftests use awk -e to parse cgroup mount points. This > works with gawk, but mawk rejects the option. In test_cpuset_prs.sh, > this leaves CGROUP2 empty and causes the test to skip as if cgroup v2 > were not mounted. The same non-portable invocation exists in the cpuset > v1 hotplug test. > > The scripts only need to pass a single awk program. Use the standard awk > invocation without -e so mount point detection works with awk > implementations that do not support the gawk extension. > > Fixes: a8c52eba880a ("kselftest/cgroup: Add cpuset v2 partition root state test") > Fixes: 812c5945bdb8 ("cgroup/cpuset: Add test_cpuset_v1_hp.sh") > Signed-off-by: Rui Qi <qirui.001@bytedance.com> > --- > tools/testing/selftests/cgroup/test_cpuset_prs.sh | 2 +- > tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > index 400a696a0d21..16c38eb11e63 100755 > --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh > +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > @@ -20,7 +20,7 @@ skip_test() { > WAIT_INOTIFY=$(cd $(dirname $0); pwd)/wait_inotify > > # Find cgroup v2 mount point > -CGROUP2=$(mount -t cgroup2 | head -1 | awk -e '{print $3}') > +CGROUP2=$(mount -t cgroup2 | head -1 | awk '{print $3}') > [[ -n "$CGROUP2" ]] || skip_test "Cgroup v2 mount point not found!" > SUBPARTS_CPUS=$CGROUP2/.__DEBUG__.cpuset.cpus.subpartitions > CPULIST=$(cat $CGROUP2/cpuset.cpus.effective) > diff --git a/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh b/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh > index 7406c24be1ac..da97f1643f9a 100755 > --- a/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh > +++ b/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh > @@ -14,7 +14,7 @@ skip_test() { > [[ $(id -u) -eq 0 ]] || skip_test "Test must be run as root!" > > # Find cpuset v1 mount point > -CPUSET=$(mount -t cgroup | grep cpuset | head -1 | awk -e '{print $3}') > +CPUSET=$(mount -t cgroup | grep cpuset | head -1 | awk '{print $3}') > [[ -n "$CPUSET" ]] || skip_test "cpuset v1 mount point not found!" > > # The test systems that I used have gawk. That is why I don't have this problem. Anyway, I support to make it more usable with other systems that use mawk. Acked-by: Waiman Long <longman@redhat.com> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] selftests/cgroup: Avoid awk -e in cpuset tests 2026-08-09 8:21 ` [PATCH 1/2] selftests/cgroup: Avoid awk -e in cpuset tests Rui Qi 2026-08-10 3:07 ` Ridong Chen 2026-08-10 14:49 ` Waiman Long @ 2026-08-10 19:36 ` Tejun Heo 2 siblings, 0 replies; 9+ messages in thread From: Tejun Heo @ 2026-08-10 19:36 UTC (permalink / raw) To: Rui Qi Cc: longman, ridong.chen, hannes, mkoutny, shuah, cgroups, linux-kselftest, linux-kernel On Sun, Aug 09, 2026 at 04:21:10PM +0800, Rui Qi wrote: > The cpuset selftests use awk -e to parse cgroup mount points. This > works with gawk, but mawk rejects the option. In test_cpuset_prs.sh, > this leaves CGROUP2 empty and causes the test to skip as if cgroup v2 > were not mounted. The same non-portable invocation exists in the cpuset > v1 hotplug test. > > The scripts only need to pass a single awk program. Use the standard awk > invocation without -e so mount point detection works with awk > implementations that do not support the gawk extension. Applied to cgroup/for-7.3. Thanks. -- tejun ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/2] selftests/cgroup: Preserve CPU hotplug write errors 2026-08-09 8:21 [PATCH 0/2] selftests/cgroup: Fix cpuset test portability and hotplug error handling Rui Qi 2026-08-09 8:21 ` [PATCH 1/2] selftests/cgroup: Avoid awk -e in cpuset tests Rui Qi @ 2026-08-09 8:21 ` Rui Qi 2026-08-10 3:22 ` Ridong Chen 2026-08-10 14:53 ` Waiman Long 1 sibling, 2 replies; 9+ messages in thread From: Rui Qi @ 2026-08-09 8:21 UTC (permalink / raw) To: Tejun Heo Cc: Waiman Long, Ridong Chen, Johannes Weiner, Michal Koutný, Shuah Khan, cgroups, linux-kselftest, linux-kernel, Rui Qi The cpuset partition root state selftest checks several CPU hotplug transitions. If writing to a CPU online file fails, the helper still runs pause afterwards and returns the status of pause instead of the failed write. This hides the real hotplug failure and can make later checks run against expectations for a transition that never happened. Move the write before the bookkeeping and return when it fails, so callers can observe the hotplug error and the test does not record a CPU as offline unless the offline operation actually succeeded. Fixes: a8c52eba880a ("kselftest/cgroup: Add cpuset v2 partition root state test") Signed-off-by: Rui Qi <qirui.001@bytedance.com> --- tools/testing/selftests/cgroup/test_cpuset_prs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh index 16c38eb11e63..a2f7208633bc 100755 --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh @@ -412,6 +412,7 @@ write_cpu_online() CPU=${1%=*} VAL=${1#*=} CPUFILE=//sys/devices/system/cpu/cpu${CPU}/online + echo $VAL > $CPUFILE || return 1 if [[ $VAL -eq 0 ]] then OFFLINE_CPUS="$OFFLINE_CPUS $CPU" @@ -421,7 +422,6 @@ write_cpu_online() sort | uniq -u) } fi - echo $VAL > $CPUFILE pause 0.05 } @@ -493,6 +493,7 @@ set_ctrl_state() eval $COMM $REDIRECT ;; O*) VAL=${CMD#?} + COMM="write_cpu_online $VAL" write_cpu_online $VAL ;; T*) COMM="echo 0 > $TFILE" -- 2.20.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] selftests/cgroup: Preserve CPU hotplug write errors 2026-08-09 8:21 ` [PATCH 2/2] selftests/cgroup: Preserve CPU hotplug write errors Rui Qi @ 2026-08-10 3:22 ` Ridong Chen 2026-08-10 14:53 ` Waiman Long 1 sibling, 0 replies; 9+ messages in thread From: Ridong Chen @ 2026-08-10 3:22 UTC (permalink / raw) To: Rui Qi, Tejun Heo Cc: Waiman Long, Johannes Weiner, Michal Koutný, Shuah Khan, cgroups, linux-kselftest, linux-kernel On 8/9/2026 4:21 PM, Rui Qi wrote: > The cpuset partition root state selftest checks several CPU hotplug > transitions. If writing to a CPU online file fails, the helper still > runs pause afterwards and returns the status of pause instead of the > failed write. > > This hides the real hotplug failure and can make later checks run > against expectations for a transition that never happened. Move the > write before the bookkeeping and return when it fails, so callers can > observe the hotplug error and the test does not record a CPU as offline > unless the offline operation actually succeeded. > > Fixes: a8c52eba880a ("kselftest/cgroup: Add cpuset v2 partition root state test") > Signed-off-by: Rui Qi <qirui.001@bytedance.com> > --- > tools/testing/selftests/cgroup/test_cpuset_prs.sh | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > index 16c38eb11e63..a2f7208633bc 100755 > --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh > +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > @@ -412,6 +412,7 @@ write_cpu_online() > CPU=${1%=*} > VAL=${1#*=} > CPUFILE=//sys/devices/system/cpu/cpu${CPU}/online > + echo $VAL > $CPUFILE || return 1 > if [[ $VAL -eq 0 ]] > then > OFFLINE_CPUS="$OFFLINE_CPUS $CPU" > @@ -421,7 +422,6 @@ write_cpu_online() > sort | uniq -u) > } > fi > - echo $VAL > $CPUFILE > pause 0.05 > } > > @@ -493,6 +493,7 @@ set_ctrl_state() > eval $COMM $REDIRECT > ;; > O*) VAL=${CMD#?} > + COMM="write_cpu_online $VAL" > write_cpu_online $VAL > ;; > T*) COMM="echo 0 > $TFILE" LGTM. Reviewed-by: Ridong Chen <ridong.chen@linux.dev> -- Best regards Ridong ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] selftests/cgroup: Preserve CPU hotplug write errors 2026-08-09 8:21 ` [PATCH 2/2] selftests/cgroup: Preserve CPU hotplug write errors Rui Qi 2026-08-10 3:22 ` Ridong Chen @ 2026-08-10 14:53 ` Waiman Long 2026-08-11 3:25 ` Rui Qi 1 sibling, 1 reply; 9+ messages in thread From: Waiman Long @ 2026-08-10 14:53 UTC (permalink / raw) To: Rui Qi, Tejun Heo Cc: Ridong Chen, Johannes Weiner, Michal Koutný, Shuah Khan, cgroups, linux-kselftest, linux-kernel On 8/9/26 4:21 AM, Rui Qi wrote: > The cpuset partition root state selftest checks several CPU hotplug > transitions. If writing to a CPU online file fails, the helper still > runs pause afterwards and returns the status of pause instead of the > failed write. > > This hides the real hotplug failure and can make later checks run > against expectations for a transition that never happened. Move the > write before the bookkeeping and return when it fails, so callers can > observe the hotplug error and the test does not record a CPU as offline > unless the offline operation actually succeeded. > > Fixes: a8c52eba880a ("kselftest/cgroup: Add cpuset v2 partition root state test") > Signed-off-by: Rui Qi <qirui.001@bytedance.com> I am aware that on x86-64, cpu0/online may not exist. Other than that, under what condition will the write fail as only root is allowed to run the script? Cheers, Longman > --- > tools/testing/selftests/cgroup/test_cpuset_prs.sh | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > index 16c38eb11e63..a2f7208633bc 100755 > --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh > +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > @@ -412,6 +412,7 @@ write_cpu_online() > CPU=${1%=*} > VAL=${1#*=} > CPUFILE=//sys/devices/system/cpu/cpu${CPU}/online > + echo $VAL > $CPUFILE || return 1 > if [[ $VAL -eq 0 ]] > then > OFFLINE_CPUS="$OFFLINE_CPUS $CPU" > @@ -421,7 +422,6 @@ write_cpu_online() > sort | uniq -u) > } > fi > - echo $VAL > $CPUFILE > pause 0.05 > } > > @@ -493,6 +493,7 @@ set_ctrl_state() > eval $COMM $REDIRECT > ;; > O*) VAL=${CMD#?} > + COMM="write_cpu_online $VAL" > write_cpu_online $VAL > ;; > T*) COMM="echo 0 > $TFILE" ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] selftests/cgroup: Preserve CPU hotplug write errors 2026-08-10 14:53 ` Waiman Long @ 2026-08-11 3:25 ` Rui Qi 0 siblings, 0 replies; 9+ messages in thread From: Rui Qi @ 2026-08-11 3:25 UTC (permalink / raw) To: Waiman Long, Tejun Heo Cc: Ridong Chen, Johannes Weiner, Michal Koutný, Shuah Khan, cgroups, linux-kselftest, linux-kernel On 8/10/26 10:53 PM, Waiman Long wrote: > On 8/9/26 4:21 AM, Rui Qi wrote: >> The cpuset partition root state selftest checks several CPU hotplug >> transitions. If writing to a CPU online file fails, the helper still >> runs pause afterwards and returns the status of pause instead of the >> failed write. >> >> This hides the real hotplug failure and can make later checks run >> against expectations for a transition that never happened. Move the >> write before the bookkeeping and return when it fails, so callers can >> observe the hotplug error and the test does not record a CPU as offline >> unless the offline operation actually succeeded. >> >> Fixes: a8c52eba880a ("kselftest/cgroup: Add cpuset v2 partition root state test") >> Signed-off-by: Rui Qi <qirui.001@bytedance.com> > > I am aware that on x86-64, cpu0/online may not exist. Other than that, > under what condition will the write fail as only root is allowed to run > the script? > > Cheers, > Longman Hi Longman, Right, the failure I wanted to preserve is not the normal permission case. Running as root only gets us past the sysfs file permission check; the write can still fail in the CPU hotplug path. For example, cpu_down() can return -EBUSY when trying to offline the last online CPU, when CPU hotplug is temporarily disabled, or when offlining would leave no housekeeping CPU. cpu_up() can also fail if the CPU is not possible/present, if hotplug is disabled, or if the CPU is not bootable under the current SMT control state. Arch or registered cpuhp callbacks may also reject the transition and return an error. The current helper hides all of those cases because it does the write and then calls pause(), so the function returns the status of pause rather than the failed sysfs write. It also updates OFFLINE_CPUS before knowing whether the offline request succeeded. So this change is mainly to avoid continuing the test with bookkeeping that says a CPU was offlined when the kernel actually rejected the hotplug operation. Thanks, Rui > >> --- >> tools/testing/selftests/cgroup/test_cpuset_prs.sh | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh >> index 16c38eb11e63..a2f7208633bc 100755 >> --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh >> +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh >> @@ -412,6 +412,7 @@ write_cpu_online() >> CPU=${1%=*} >> VAL=${1#*=} >> CPUFILE=//sys/devices/system/cpu/cpu${CPU}/online >> + echo $VAL > $CPUFILE || return 1 >> if [[ $VAL -eq 0 ]] >> then >> OFFLINE_CPUS="$OFFLINE_CPUS $CPU" >> @@ -421,7 +422,6 @@ write_cpu_online() >> sort | uniq -u) >> } >> fi >> - echo $VAL > $CPUFILE >> pause 0.05 >> } >> >> @@ -493,6 +493,7 @@ set_ctrl_state() >> eval $COMM $REDIRECT >> ;; >> O*) VAL=${CMD#?} >> + COMM="write_cpu_online $VAL" >> write_cpu_online $VAL >> ;; >> T*) COMM="echo 0 > $TFILE" ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-08-11 3:25 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-08-09 8:21 [PATCH 0/2] selftests/cgroup: Fix cpuset test portability and hotplug error handling Rui Qi 2026-08-09 8:21 ` [PATCH 1/2] selftests/cgroup: Avoid awk -e in cpuset tests Rui Qi 2026-08-10 3:07 ` Ridong Chen 2026-08-10 14:49 ` Waiman Long 2026-08-10 19:36 ` Tejun Heo 2026-08-09 8:21 ` [PATCH 2/2] selftests/cgroup: Preserve CPU hotplug write errors Rui Qi 2026-08-10 3:22 ` Ridong Chen 2026-08-10 14:53 ` Waiman Long 2026-08-11 3:25 ` Rui Qi
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.