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 BE30539F168 for ; Thu, 13 Aug 2026 17:37:50 +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=1786642672; cv=none; b=VAyrdTXawGyGispzoGn4n05022Mk6sSwUYBgDvvEVds5lV6y4ZOZoaeVdJbmzMfQRjZWrBhOrgKUS2ZmqL+Fu88IQMSIKEvEkLuauiQt+3m0o/s9L9sGGwEALDMZuUg4hCan2ycJXnp55tkX59FID8/D/BSVTYN2B4b9zqP6oWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786642672; c=relaxed/simple; bh=YVwjop3zN1+ix4I/Z7V+3v+w7UcV6+5AajwMsjSaT6s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kSfXObvzZWG47UyvNDqlGHC7NK18XU+9zwhGa28W+kqCzv+ymLsiTXFwkDChy5qW8V8RRn+tp08JXVUCfBGKTqXWvBbcPNZqaKJI0MjtDn0bI2WoBQk9Yqxd9lCTNMglyBVegW66z9kMdPfCbAJYwiW3FliA45fqGZHmod1vWXM= 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=E8MwScA5; 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="E8MwScA5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786642664; 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=NL/Ss/WucsHJWaG/IMcbw3TMkIVpT03vS4hL/xuSrgA=; b=E8MwScA5RNyBsJMR49aUKo4E4E3R8OC3g37sw2W6JoXOyTow8urC5dOnW42GLxkSNXTFSn xiPdu6rkrC/hw7kISZVYXLohPBoChqOugK7FbIYn9UebVQU04V/pyTbu2W+/v24ehMB8NP yFyn0/ozh0KZ0soPOGnP9kt+r+Vkhyc= 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-146-0hWdB7PuMjyfxsR0EkEJGQ-1; Thu, 13 Aug 2026 13:37:41 -0400 X-MC-Unique: 0hWdB7PuMjyfxsR0EkEJGQ-1 X-Mimecast-MFC-AGG-ID: 0hWdB7PuMjyfxsR0EkEJGQ_1786642659 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B42BF1955DAF; Thu, 13 Aug 2026 17:37:39 +0000 (UTC) Received: from [100.91.18.181] (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AB51C30001A2; Thu, 13 Aug 2026 17:37:38 +0000 (UTC) Message-ID: Date: Thu, 13 Aug 2026 13:37:37 -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] selftests/cgroup: Preserve CPU hotplug write errors To: Rui Qi , linux-cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Cc: tj@kernel.org, lizefan.x@bytedance.com, shuah@kernel.org References: <20260809082111.3827531-3-qirui.001@bytedance.com> <20260813132807.1160861-1-qirui.001@bytedance.com> Content-Language: en-US From: Waiman Long In-Reply-To: <20260813132807.1160861-1-qirui.001@bytedance.com> 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 8/13/26 9:28 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. > > Also change the O* command handler in set_ctrl_state() to use > "eval $COMM $REDIRECT" like all other handlers. The previous version > set COMM but still called write_cpu_online directly, bypassing the > redirect that captures stderr for error reporting. > > Changes since v1: > - Use eval $COMM $REDIRECT in the O* handler instead of calling > write_cpu_online directly (Waiman Long) > > Fixes: a8c52eba880a ("kselftest/cgroup: Add cpuset v2 partition root state test") > Signed-off-by: Rui Qi > --- > tools/testing/selftests/cgroup/test_cpuset_prs.sh | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > index 8380fd9d76bd..da8f7b920178 100755 > --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh > +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh > @@ -526,6 +526,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" > @@ -535,7 +536,6 @@ write_cpu_online() > sort | uniq -u) > } > fi > - echo $VAL > $CPUFILE > pause 0.05 > } > > @@ -603,7 +603,8 @@ set_ctrl_state() > eval $COMM $REDIRECT > ;; > O*) VAL=${CMD#?} > - write_cpu_online $VAL > + COMM="write_cpu_online $VAL" > + eval $COMM $REDIRECT > ;; > T*) COMM="echo 0 > $TFILE" > eval $COMM $REDIRECT Reviewed-by: Waiman Long