From nobody Mon Apr 6 18:24:01 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 04526313556; Mon, 6 Apr 2026 09:21:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775467283; cv=none; b=jG39l1STbSffG8/Pqp9NFKfTCwHFInZaNdGy7aCFImvdSlUokLJXYN0Jg9gwnNLlQG8/I48he+XH+9C0rtVlJDyAut3kRwgS904JAEmLbtaiUcqIj1Z/zKziuTZSydtda9HiJTABmml6yD3/vfKKkdYLcHlTPY9iLIlVt8x9Uz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775467283; c=relaxed/simple; bh=H4lQSgEuqbh/aU8eQfkByYVKk2DxkbwPRqXyaT6jI6M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oocRpfnfeKMDF9C66z4iS1D0Tq7wTh4Rf/XC0LrNVzb011KIIMM/HE/OmSLvOEnUuk3cZ3MgvIwvkSBkhpTJSDc8DiuZLcG5cZxDx0+BiWDaPuH3XEN+HXkvyCl81FoAXMTTHQarTGFzBSxng9UNinWAkZrgY/9G5qF5bNEdxGk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=DJrgnWAx; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="DJrgnWAx" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 635NHOWM3843862; Mon, 6 Apr 2026 09:20:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=IzW3nDJIXN8nsOHEr Rm2SdUBfyLuevkgaiMQu8YlHjo=; b=DJrgnWAxI0s+EN9MXFk/IFww26nA1vFN4 5n48QJ3MBLa/22Pzd/frmFvmQrG24BKIlIyuTxBI7fv5xL8ncwVqbpNwfZXHe/Mx sAP6DLueZdG4zor8HYb+lpCQ5Zu8/SRMRCvHj1SrYkZsuJInpz9Oaas41qFR78BI 6ws6pvtZ9kYCGW75F3oldzDG09HnV+pRo9QzO0+t3qdlsJX6ZKK1FS+Ewid4bTgu 1lliWf4mXCBN+b5sbW7n0J5EU/y37ihy9LkCYw7CW5RQ+LPSbJmgk7gL2JUHs+uX MqXIbuuSy5Qg2S7OgmnpyiRJWTgGJEkSoJZ7It5kcHypMwwjJVzpA== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dar2gdnxh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Apr 2026 09:20:02 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 6365xCrs020514; Mon, 6 Apr 2026 09:20:01 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4dbdync2vk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Apr 2026 09:20:01 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6369Jvev52494842 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Apr 2026 09:19:58 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CFE4A20043; Mon, 6 Apr 2026 09:19:57 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8CDFA20040; Mon, 6 Apr 2026 09:19:54 +0000 (GMT) Received: from li-3f69264c-2ce6-11b2-a85c-c3f414d24014.bl1-in.ibm.com (unknown [9.123.3.209]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Apr 2026 09:19:54 +0000 (GMT) From: Sayali Patil To: Andrew Morton , Shuah Khan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Ritesh Harjani Cc: David Hildenbrand , Zi Yan , Michal Hocko , Oscar Salvador , Lorenzo Stoakes , Dev Jain , Liam.Howlett@oracle.com, linuxppc-dev@lists.ozlabs.org, Miaohe Lin , Venkat Rao Bagalkote , Sayali Patil Subject: [PATCH v4 04/15] selftests/mm: fix hugetlb pathname construction in hugetlb_reparenting_test.sh Date: Mon, 6 Apr 2026 14:49:23 +0530 Message-ID: X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-GUID: laJStrGfrx-5hJqn0NaLVa4oNMtk1AUV X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDA2MDA5MCBTYWx0ZWRfX/FdR5335PD2E vWUZJkT4KGTtLa+POhqWXvuXW0SIszX2yllb2+hrG1V53QXPbpVQVUdU3QbjghEZEhfgxZ+szN4 mqKns4U3miZD5SB/ku3RR4iLgWmbNuKsACyKT87baMpiUpW+TdZI56Llot+bZI4yTxAOUZ5m02B 74/hZvf2SZwyzezpZiREsOO9ZoeXnqBPt1VPD0VIxDFrVLNC/IEFDOp3HEN0m+hozD12XkxNiFb mvD/tuUUeNo/onwp+7U9gvulLzPiUEO0TkTLH5CqXwZXm2E+RcenMP2jZz1MvRPZ49xvEV08s2s oZfq5vmkkE6CLgBWJI5wtZlhGwFsdveZ5Ic3tlhwR+YQPCZ9a4MUQfkVt8bEyNamG6INqKwNfo8 P8+o9p42mBMHFhGAnVoFED+3f1gEGM6ROr/ixcHczJm9vS1GOcareXKXP2xpbMVkDjubGCboekU gkl4sL1DnCYOQ1E6w6g== X-Authority-Analysis: v=2.4 cv=b+u/I9Gx c=1 sm=1 tr=0 ts=69d37ac3 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=Ikd4Dj_1AAAA:8 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=7yu59zDboRqKFyXxuvEA:9 X-Proofpoint-ORIG-GUID: JDz4J-ei1bkd7_U0fa4EqpJcExAwF915 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-06_02,2026-04-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 spamscore=0 priorityscore=1501 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2604060090 Content-Type: text/plain; charset="utf-8" The hugetlb_reparenting_test.sh script constructs hugetlb cgroup memory interface file names based on the configured huge page size. The script formats the size only in MB units, which causes mismatches on systems using larger huge pages where the kernel exposes normalized units (e.g. "1GB" instead of "1024MB"). As a result, the test fails to locate the corresponding cgroup files when 1GB huge pages are configured. Update the script to detect the huge page size and select the appropriate unit (MB or GB) so that the constructed paths match the kernel's hugetlb controller naming. Also print an explicit "Fail" message when a test failure occurs to improve result visibility. Fixes: e487a5d513cb ("selftest/mm: make hugetlb_reparenting_test tolerant t= o async reparenting") Reviewed-by: Zi Yan Acked-by: David Hildenbrand (Arm) Tested-by: Venkat Rao Bagalkote Signed-off-by: Sayali Patil --- .../selftests/mm/hugetlb_reparenting_test.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh b/tools= /testing/selftests/mm/hugetlb_reparenting_test.sh index 7ddb370e1572..00f3f3cd8909 100755 --- a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh +++ b/tools/testing/selftests/mm/hugetlb_reparenting_test.sh @@ -48,6 +48,13 @@ function get_machine_hugepage_size() { } =20 MB=3D$(get_machine_hugepage_size) +if (( MB >=3D 1024 )); then + UNIT=3D"GB" + MB_DISPLAY=3D$((MB / 1024)) +else + UNIT=3D"MB" + MB_DISPLAY=3D$MB +fi =20 function cleanup() { echo cleanup @@ -88,6 +95,7 @@ function assert_with_retry() { if [[ $elapsed -ge $timeout ]]; then echo "actual =3D $((${actual%% *} / 1024 / 1024)) MB" echo "expected =3D $((${expected%% *} / 1024 / 1024)) MB" + echo FAIL cleanup exit 1 fi @@ -108,11 +116,13 @@ function assert_state() { fi =20 assert_with_retry "$CGROUP_ROOT/a/memory.$usage_file" "$expected_a" - assert_with_retry "$CGROUP_ROOT/a/hugetlb.${MB}MB.$usage_file" "$expecte= d_a_hugetlb" + assert_with_retry \ + "$CGROUP_ROOT/a/hugetlb.${MB_DISPLAY}${UNIT}.$usage_file" "$expected_a_= hugetlb" =20 if [[ -n "$expected_b" && -n "$expected_b_hugetlb" ]]; then assert_with_retry "$CGROUP_ROOT/a/b/memory.$usage_file" "$expected_b" - assert_with_retry "$CGROUP_ROOT/a/b/hugetlb.${MB}MB.$usage_file" "$exp= ected_b_hugetlb" + assert_with_retry \ + "$CGROUP_ROOT/a/b/hugetlb.${MB_DISPLAY}${UNIT}.$usage_file" "$expected_= b_hugetlb" fi } =20 --=20 2.52.0