Re: [PATCH RFC v2 01/22] cpuset: fix isolcpus stay in root when isolated partition changes to root

From: Chen Ridong

Date: Wed Nov 12 2025 - 20:24:50 EST




On 2025/11/13 4:09, Waiman Long wrote:
> On 10/25/25 2:48 AM, Chen Ridong wrote:
>> From: Chen Ridong <chenridong@xxxxxxxxxx>
>>
>> A bug was detected with the following steps:
>>
>>    # cd /sys/fs/cgroup/
>>    # mkdir test
>>    # echo 9 > test/cpuset.cpus
>>    # echo isolated > test/cpuset.cpus.partition
>>    # cat test/cpuset.cpus.partition
>>    isolated
>>    # cat test/cpuset.cpus
>>    9
>>    # echo root > test/cpuset.cpus.partition
>>    # cat test/cpuset.cpus
>>    9
>>    # cat test/cpuset.cpus.partition
>>    root
>>
>> CPU 9 was initially listed in the "isolcpus" boot command line parameter.
>> When the partition type is changed from isolated to root, CPU 9 remains
>> in what becomes a valid root partition. This violates the rule that
>> isolcpus can only be assigned to isolated partitions.
>>
>> Fix this by adding a housekeeping conflict check during transitions
>> between root and isolated partitions.
>>
>> Fixes: 4a74e418881f ("cgroup/cpuset: Check partition conflict with housekeeping setup")
>> Signed-off-by: Chen Ridong <chenridong@xxxxxxxxxx>
>> ---
>>   kernel/cgroup/cpuset.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
>> index 96104710a649..6af4d80b53c4 100644
>> --- a/kernel/cgroup/cpuset.c
>> +++ b/kernel/cgroup/cpuset.c
>> @@ -2995,6 +2995,8 @@ static int update_prstate(struct cpuset *cs, int new_prs)
>>            * Need to update isolated_cpus.
>>            */
>>           isolcpus_updated = true;
>> +        if (prstate_housekeeping_conflict(new_prs, cs->effective_xcpus))
>> +            err = PERR_HKEEPING;
>>       } else {
>>           /*
>>            * Switching back to member is always allowed even if it
>
> This patch has been merged in somewhat different form.
>
> Cheers,
> Longman
>

Yes, I know, I will drop this patch.

Thanks,

--
Best regards,
Ridong