在 2026/8/24 22:31, Waiman Long 写道:
> On 8/20/26 8:41 AM, Guopeng Zhang wrote:
>> From: Guopeng Zhang <[email protected]>
>>
>> Create an isolated child which owns a CPU isolated at boot, then change
>> its parent from isolated to root. Check that the change succeeds without
>> altering the child or its isolated CPU.
>>
>> Signed-off-by: Guopeng Zhang <[email protected]>
>> ---
>> .../selftests/cgroup/test_cpuset_prs.sh | 47 +++++++++++++++++++
>> 1 file changed, 47 insertions(+)
>>
>> diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
>> b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
>> index 9a1cce4807b4..bc8dbb724d5c 100755
>> --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
>> +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
>> @@ -1214,6 +1214,52 @@ test_boot_isolated()
>> echo "$TEST_NAME test PASSED."
>> }
>> +#
>> +# A parent's type change must validate only CPUs owned directly by the
>> parent,
>> +# not a boot-isolated CPU owned by a valid isolated child partition.
>> +#
>> +test_owned_cpus_housekeeping()
>> +{
>> + TEST_NAME="Child-owned CPU type change"
>> + get_boot_isolated_cpu "$TEST_NAME" || return 0
>> + echo "Running $TEST_NAME test ..."
>> +
>> + cd $CGROUP2/test
>> + echo member > cpuset.cpus.partition
>> + echo +cpuset > cgroup.subtree_control
>> + echo 2,$BOOT_CPU > cpuset.cpus
>> + [[ $(cat cpuset.cpus.effective) = "2,$BOOT_CPU" ]] || {
>
> You are using the same BOOT_CPU set up in get_boot_isolated_cpu() in patch 3.
> That creates an hidden dependency on the order of the tests. I will suggest
> that you set up BOOT_CPU and BOOT_CPUS as part of the initialization so the
> data is available to all the tests that want to use it.
>
That makes sense. I will move the initialization of BOOT_CPUS and
BOOT_CPU to the setup stage in v2.
Thanks,
Guopeng