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.129.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 E9A3A549364 for ; Tue, 13 Oct 2026 22:43:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791931433; cv=none; b=qfhCjRRvt+VSvrjG9s9JdKJmDqeS+CAlhHHMFh0UC4TGmKl4Amzio/JyV5ugOriV9RHCpiT9C17RvVKlngG8DfR5jjbrXjy18Y7DljEE6e1Tb1g+VFi3btE7G4UxyDf8jcYPzmnx8Lv07juN24CD+aI0lT2Inrw0Aeyteaj3H4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791931433; c=relaxed/simple; bh=IGuvyB5PbhIzeePVFzAtrlhGsL24P9yuKC8V+/pp3+s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aZT3HrO2ZhieLLk8aM+VDCq51jHHhrsO1pU6go9JxhelDaCAEvDpZUXSp0gCQ9oZQdGQEJjeK3AYN7TBJ5lPmw1lWkBhBdjW6l9ddMFRFNAgc9cIw0B04i/NKPiiru4fUBeQQ+7ULddeaJwUPN+Nq0B8Tbu0zip4wEYXcZCNFX0= 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=CeRD7TJK; arc=none smtp.client-ip=170.10.129.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="CeRD7TJK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791931430; 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=tTgDO4Q2/ydtZMP24HXgy3ERsMnbYlaCJjw/o3smb7I=; b=CeRD7TJKUUb9QL81Jj47lu7hy/yAsFZleNWnITo0cOu57MceMBjYgaclPg1iva3T187tIW G3kaK40AkWtXy0mkQAuCfGpIssz1ZmcXgA7HCnSum9FAoyZVrZxj2gQKYweTs4I/AAgzqZ 5USgToKplLSEuxCft9xWUGkVsQBUUpY= Received: from mx-prod-mc-01.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-649-8UUp0W2wPiGbeECf08Uxow-1; Tue, 13 Oct 2026 22:43:44 +0000 X-MC-Unique: 8UUp0W2wPiGbeECf08Uxow-1 X-Mimecast-MFC-AGG-ID: 8UUp0W2wPiGbeECf08Uxow_1791931421 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 404061956077; Tue, 13 Oct 2026 22:43:41 +0000 (UTC) Received: from [100.91.18.181] (headnet03.pony-001.prod.iad2.dc.redhat.com [10.2.32.114]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 314881800345; Tue, 13 Oct 2026 22:43:38 +0000 (UTC) Message-ID: <4dbdc6ab-7c3a-4c8b-ba88-f5089f2b619b@redhat.com> Date: Tue, 13 Oct 2026 18:43:38 -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-next v2 6/6] selftests/cgroup: Skip test_cpuset_prs.sh test if some required CPUs are offline To: Guopeng Zhang , Ridong Chen , Tejun Heo , Johannes Weiner , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Shuah Khan Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Hui Peng References: <20261010221938.243859-1-longman@redhat.com> <20261010221938.243859-7-longman@redhat.com> <27675c88-061c-4f84-9387-324071a16b45@linux.dev> Content-Language: en-US From: Waiman Long In-Reply-To: <27675c88-061c-4f84-9387-324071a16b45@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 On 10/11/26 5:00 AM, Guopeng Zhang wrote: > > 在 2026/10/11 06:19, Waiman Long 写道: >> The test_cpuset_prs.sh test assumes that all the relevant CPUs being >> tested are online. If some of them are offline, some of the test cases >> may fail. So skip the test if the required CPUs are either offline or >> not present. >> >> Signed-off-by: Waiman Long >> --- >> .../selftests/cgroup/test_cpuset_prs.sh | 20 +++++++++++++++++++ >> 1 file changed, 20 insertions(+) >> >> diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh >> index 3d392e8c66aa..f57971ebb90e 100755 >> --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh >> +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh >> @@ -118,6 +118,26 @@ TEST_ISOLCPUS= >> skip_test "Current isolated CPUs ($CURRENT_ISOLCPUS) don't match boot isolated CPUs!" >> } >> >> +# >> +# This test assumes that all the relevant CPUs being tested are online. >> +# If some of them are offline, some of the tests may fail. So we are going to >> +# skip running this test script if some of the required CPUs may be offline. >> +# The required CPUs include CPUs 0-7 and the first boot time isolated CPU if >> +# present. However the check below is not exhaustive and can be a false >> +# positive, but users should not run this test if some CPUs are offline. >> +# >> +ONLINE_CPUS=$(cat /sys/devices/system/cpu/online | sed -e "s/,.*//") >> +ONLINE_FIRST=$(echo $ONLINE_CPUS | sed -e "s/-.*//") >> +ONLINE_LAST=$(echo $ONLINE_CPUS | sed -e "s/.*-//") >> +if [[ -n "$FIRST_ISOLCPUS" ]] >> +then >> + LAST_REQUIRED_CPU=$FIRST_ISOLCPUS >> +else >> + LAST_REQUIRED_CPU=7 >> +fi >> +[[ $ONLINE_FIRST != 0 || $ONLINE_LAST -lt $LAST_REQUIRED_CPU ]] && >> + skip_test "Some of the required CPUs are offline or not present!" >> + > Could this check run before the setup that creates the test cgroup and > changes sched/verbose? > > skip_test() exits directly, and the cleanup trap hasn't been installed > here. We have already created test; with -v, sched/verbose has also been > set to Y. This exit leaves the cgroup behind and bypasses restoring > verbose. Good point. I am going to move the trap statement earlier to make sure that it will be run when there is an early abort. Cheers, Longman