From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B4CE3DF000 for ; Wed, 27 May 2026 18:08:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779905312; cv=none; b=cAT01tpv3T7u6l29os8FJatDn+6gDRgR5+zJUkyLahKD1HLy18WY0ehaA1VkCnG3RpHlj5eJ5pWNEyx2zGY+1JdHASWCPp6j3hl3dP6TxWmhpVisqSF4lDJiLfCB3Yf6tlvtjDgVC6QC+mj4Ethz6c9/0/nH7ZnbGGForzuNnA4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779905312; c=relaxed/simple; bh=GtyaSp5Y+ds83ODyqjs2n+z6purm3AZE14zVAYgP2z8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oQ3NpFeSfmMmJmVGZWq6LHkhCQ5Oe/84AluTrGvPG3usgV2waSGGPOOuBpBz1PIj4Yr7YIKKUms+wgQDLEDYAun28QRITdHBPXxT8/7la4UNF4RlxUtVKbccD3sqFofVIvsGA/qnExgtx2YXnjaoiNrMdG+f4UZj2hNOp7ZPZG0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=UDJd16t5; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UDJd16t5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779905310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2Fgd+efNwqntOKX5XsyATvXQpChpjwSIW92ST2XHIBk=; b=UDJd16t5/8FMg6DWoEgEtYXOp1Cra4Y7VssDEOyemmwzzf6pHArm5DfBY3fzK9oYfHczYx 4HuGUQjrkgFF7Ugi/zNZZ8CPpjo6wHtC3TPC+4TqrQwL9ZVSghZupEEoNyjjs8KFtHkgyB +IX6yC3xT1nV1dlEtUGsSZOxtUMHqhQ= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-588-NNVpxq7yMQiktciWluSaIQ-1; Wed, 27 May 2026 14:08:25 -0400 X-MC-Unique: NNVpxq7yMQiktciWluSaIQ-1 X-Mimecast-MFC-AGG-ID: NNVpxq7yMQiktciWluSaIQ_1779905304 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B134A1956094; Wed, 27 May 2026 18:08:23 +0000 (UTC) Received: from [10.22.81.53] (unknown [10.22.81.53]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C6ED830002DC; Wed, 27 May 2026 18:08:21 +0000 (UTC) Message-ID: <5289760b-a2a7-4043-962f-49582ddc40ed@redhat.com> Date: Wed, 27 May 2026 14:08:20 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] cgroup/cpuset: Add test cases for sibling CPU exclusion on partition update To: Sun Shaojie , Chen Ridong , Tejun Heo , Johannes Weiner , =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, zhangguopeng@kylinos.cn References: <20260527064329.640060-2-sunshaojie@kylinos.cn> <20260527070509.648304-1-sunshaojie@kylinos.cn> Content-Language: en-US From: Waiman Long In-Reply-To: <20260527070509.648304-1-sunshaojie@kylinos.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 On 5/27/26 3:05 AM, Sun Shaojie wrote: > When sibling CPU exclusion occurs, a partition's effective_xcpus may be > a subset of its user_xcpus. The partcmd_update path must use > effective_xcpus instead of user_xcpus when calculating CPUs to return > to or request from the parent. > > Add two test cases to verify this behavior: > > 1) Narrowing cpuset.cpus to only the sibling-excluded CPUs should not > return CPUs to parent that the partition never actually owned. > > 2) Expanding cpuset.cpus after a sibling becomes a member should > correctly request the additional CPUs from parent. > > Co-developed-by: Zhang Guopeng > Signed-off-by: Zhang Guopeng > Signed-off-by: Sun Shaojie > --- > tools/testing/selftests/cgroup/test_cpuset_prs.sh | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > index a56f4153c64d..683b05062810 100755 > --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh > +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > @@ -492,6 +492,16 @@ REMOTE_TEST_MATRIX=( > " C1-5:P1 . C1-4:P1 C2-3 . . \ > . . . P1 . . p1:5|c11:1-4|c12:5 \ > p1:P1|c11:P1|c12:P-1" > + # Narrowing cpuset.cpus to previously sibling-excluded CPUs should > + # not return CPUs that were never actually owned. > + " C1-4:P1 . C1-2:P1 C1-3:P2 . . \ > + . . . C3 . . p1:4|c11:1-2|c12:3 \ > + p1:P1|c11:P1|c12:P2 3" > + # Expanding cpuset.cpus to include a previously sibling-excluded CPU > + # after the sibling has become a member should correctly request it. > + " C1-4:P1 . C1-2:P1 C1-3:P2 . . \ > + . . P0 C2-3 . . p1:1,4|c11:1|c12:2-3 \ > + p1:P1|c11:P0|c12:P2 2-3" > ) > > # Reviewed-by: Waiman Long