From nobody Tue Sep 29 10:32:57 2026 Received: from va-1-111.ptr.blmpb.com (va-1-111.ptr.blmpb.com [209.127.230.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A55C3A05FC for ; Sun, 9 Aug 2026 08:21:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.230.111 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786263711; cv=none; b=t+BRK4e93TBHUk665KmqzRxhVcTpRbq3lO0NUVaz9OludgU3AQT/7/YRDblasA694nHJogL5HfJnLSnIGAFU+AViTAeSflbKJwMFX/dZZcOq8PetdyAa9h4f5fPm/P6+9KZUmsEn0/tVNhNsnk+jEWqPFk8yBbsV7gAOn8YWJ4I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786263711; c=relaxed/simple; bh=6xga2Rem33SBu03y3gctGh9ND9hhWHOzbjuyhtOHQzo=; h=Message-Id:In-Reply-To:References:Content-Type:To:Cc:Subject: Mime-Version:Date:From; b=iY1V9Nfby2dOIiLP6LuaSd83dQOeMgyS605GJwOQliL9FT6MPl9Zn0mI+1yFuG8arjfQEmaoMN74pshrmNJQzBX7riE+kBwlx4UYdVnc2vvRjXbOlQP9+8uhIB87AFHTYQEzPco3s41Hg7I+2b5OapFfcCt8lXunkGzchCR/Kio= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=YCZc5CWD; arc=none smtp.client-ip=209.127.230.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="YCZc5CWD" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1786263697; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=0Yk0lYL9aqPBymANq4am5jSB+FYd5S9sbi6/i8dc480=; b=YCZc5CWDxLfbLTzlyJ0VYTLolNveLYQYsBvLsJZx0IL1+1IOHu0F4E8XwKaqblJVpDIYPB aArDrZkWSFZCN6DarCHZ3U9THa/STwjW0qPvV/B7yc790Utygxz2r2oUYaLB/Gj4zZV6OC hpqGrs3due4wTvYwIyxTT2l3vdM9r7mRpGOb7zvmd8rF7jQVyZ+LsobnoTFnDBVavEuAMv sXO+jJdkxJFV4POvkEl+AcQYXSYAdf3AFblnNsi5xikifTxwYgbqyOCY17i+o/fJLrp+Ey cnNvOC0LD+fz1aS6o82OjqGuyjNpba1Gu5sqzK8ojitLLUdbMzjMDpX1tE4+jw== Message-Id: <20260809082111.3827531-2-qirui.001@bytedance.com> X-Original-From: Rui Qi In-Reply-To: <20260809082111.3827531-1-qirui.001@bytedance.com> References: <20260809082111.3827531-1-qirui.001@bytedance.com> X-Mailer: git-send-email 2.20.1 Content-Transfer-Encoding: quoted-printable To: "Tejun Heo" Cc: "Waiman Long" , "Ridong Chen" , "Johannes Weiner" , =?utf-8?q?Michal_Koutn=C3=BD?= , "Shuah Khan" , , , , "Rui Qi" Subject: [PATCH 1/2] selftests/cgroup: Avoid awk -e in cpuset tests Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Lms-Return-Path: Date: Sun, 9 Aug 2026 16:21:10 +0800 From: "Rui Qi" Content-Type: text/plain; charset="utf-8" The cpuset selftests use awk -e to parse cgroup mount points. This works with gawk, but mawk rejects the option. In test_cpuset_prs.sh, this leaves CGROUP2 empty and causes the test to skip as if cgroup v2 were not mounted. The same non-portable invocation exists in the cpuset v1 hotplug test. The scripts only need to pass a single awk program. Use the standard awk invocation without -e so mount point detection works with awk implementations that do not support the gawk extension. Fixes: a8c52eba880a ("kselftest/cgroup: Add cpuset v2 partition root state = test") Fixes: 812c5945bdb8 ("cgroup/cpuset: Add test_cpuset_v1_hp.sh") Signed-off-by: Rui Qi Acked-by: Waiman Long Reviewed-by: Ridong Chen --- tools/testing/selftests/cgroup/test_cpuset_prs.sh | 2 +- tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/test= ing/selftests/cgroup/test_cpuset_prs.sh index 400a696a0d21..16c38eb11e63 100755 --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh @@ -20,7 +20,7 @@ skip_test() { WAIT_INOTIFY=3D$(cd $(dirname $0); pwd)/wait_inotify =20 # Find cgroup v2 mount point -CGROUP2=3D$(mount -t cgroup2 | head -1 | awk -e '{print $3}') +CGROUP2=3D$(mount -t cgroup2 | head -1 | awk '{print $3}') [[ -n "$CGROUP2" ]] || skip_test "Cgroup v2 mount point not found!" SUBPARTS_CPUS=3D$CGROUP2/.__DEBUG__.cpuset.cpus.subpartitions CPULIST=3D$(cat $CGROUP2/cpuset.cpus.effective) diff --git a/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh b/tools/te= sting/selftests/cgroup/test_cpuset_v1_hp.sh index 7406c24be1ac..da97f1643f9a 100755 --- a/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh +++ b/tools/testing/selftests/cgroup/test_cpuset_v1_hp.sh @@ -14,7 +14,7 @@ skip_test() { [[ $(id -u) -eq 0 ]] || skip_test "Test must be run as root!" =20 # Find cpuset v1 mount point -CPUSET=3D$(mount -t cgroup | grep cpuset | head -1 | awk -e '{print $3}') +CPUSET=3D$(mount -t cgroup | grep cpuset | head -1 | awk '{print $3}') [[ -n "$CPUSET" ]] || skip_test "cpuset v1 mount point not found!" =20 # --=20 2.20.1 From nobody Tue Sep 29 10:32:57 2026 Received: from va-1-113.ptr.blmpb.com (va-1-113.ptr.blmpb.com [209.127.230.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C40333A05FC for ; Sun, 9 Aug 2026 08:21:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.230.113 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786263717; cv=none; b=XnnHrK3uTEJy9ROMVbRFoEqug/uvIU5tPQedff3yAFR2S6VNN0UMTaAimmpdFYWz19T8ROWJewXhH4bdFUIiEej68uEx8j5HZyGyqy+m4ZHpJhx+7HXnSaHv3Z1Xfi0xIutQCawTdX3KJl3rjV5eBlPmskOoGT4i85Oyo12HYqU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786263717; c=relaxed/simple; bh=FrECniDkg8YKqMi0Smbs3zq22i2qjrcQ6gW/2ZUChZQ=; h=Content-Type:Subject:References:To:From:Mime-Version:In-Reply-To: Cc:Date:Message-Id; b=eEc0dSMxRbSo27SQ5DIRcU/dYZP6BH5d57b9HPFSAxaSeaOU9Mvopxdggz2S5GY7s1TAI1/AlEVkQBYVlqviH0iVnY6T6Rq/DI0uwGLkQcYSbcK5y7Q3RGEQRX/KlmHu5nqpfaOvxK8tv8tXoJVrgCkpt+FokXuUVXazpH0AU9I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=nJzrUsVF; arc=none smtp.client-ip=209.127.230.113 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="nJzrUsVF" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1786263708; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=muA4oqikWdywQP1E8XrJ2gVJyxiRqn34qvWdx3tjp1c=; b=nJzrUsVFgU0cEeQtsIYydE67fJJbjAoEUT4oV16FlL5Om2lSayfUb3hyQIMamhUB0XZ0f2 9KaWZPG0/LJg0kbCbwJjMPDPBwKaMErPtPA6vOjhRThVV2BNdo5PJNkYV1q3e5yor9aztC dfSV9zch7Lr5rKkcYKdZXZR8OtKS1pOtZLNH122XohSy2NjNX3t0WDo3PhicLLqK/blWbb TY8JKY/gSGshUyFAAlL9vaIeH3DW9ypvr5AAisZMY2CO9sj911jG8FNv6VVi30Q5EsihsI cfI/Bnbce5GvHckSt+S3uXYA+4HL22i5ZMG2qvikry7FUsnipNhv1R7By8BbOg== Subject: [PATCH 2/2] selftests/cgroup: Preserve CPU hotplug write errors X-Lms-Return-Path: References: <20260809082111.3827531-1-qirui.001@bytedance.com> X-Mailer: git-send-email 2.20.1 X-Original-From: Rui Qi To: "Tejun Heo" From: "Rui Qi" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 In-Reply-To: <20260809082111.3827531-1-qirui.001@bytedance.com> Cc: "Waiman Long" , "Ridong Chen" , "Johannes Weiner" , =?utf-8?q?Michal_Koutn=C3=BD?= , "Shuah Khan" , , , , "Rui Qi" Date: Sun, 9 Aug 2026 16:21:11 +0800 Message-Id: <20260809082111.3827531-3-qirui.001@bytedance.com> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Fixes: a8c52eba880a ("kselftest/cgroup: Add cpuset v2 partition root state = test") Signed-off-by: Rui Qi Reviewed-by: Ridong Chen --- tools/testing/selftests/cgroup/test_cpuset_prs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/test= ing/selftests/cgroup/test_cpuset_prs.sh index 16c38eb11e63..a2f7208633bc 100755 --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh @@ -412,6 +412,7 @@ write_cpu_online() CPU=3D${1%=3D*} VAL=3D${1#*=3D} CPUFILE=3D//sys/devices/system/cpu/cpu${CPU}/online + echo $VAL > $CPUFILE || return 1 if [[ $VAL -eq 0 ]] then OFFLINE_CPUS=3D"$OFFLINE_CPUS $CPU" @@ -421,7 +422,6 @@ write_cpu_online() sort | uniq -u) } fi - echo $VAL > $CPUFILE pause 0.05 } =20 @@ -493,6 +493,7 @@ set_ctrl_state() eval $COMM $REDIRECT ;; O*) VAL=3D${CMD#?} + COMM=3D"write_cpu_online $VAL" write_cpu_online $VAL ;; T*) COMM=3D"echo 0 > $TFILE" --=20 2.20.1