From nobody Tue Apr 7 18:08:08 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 BB6662D1F40; Thu, 12 Mar 2026 12:26:28 +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=1773318390; cv=none; b=roK6mlSchU2m3Ds065dxfOo9UBgP3mp1R54buTc7V2YX2G3Fys1IGQ4PgvC24KSvkec3nsvhCZeB1P3/VSMUdVGwSd6axAP8AWWWboLXiFetQSD4crPcw3uBgOya5JESw4ycUaQFEz44GbCs6EiUv0GXl80sQ2bQVdv1/HPjbiM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773318390; c=relaxed/simple; bh=vsDXEjTRp5UfITxj5gNIWrTh//3ghwc+kj2BQtQNSwg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i/G7FN9gmz/fFQ7oaXB/IyX5CiMs64w+3AiHv82HEEnvA5hEZ2UWMy7VzDEapvYzjDwU110gX2/b9bY7KPUxwgtlaFSWVRPaeYlMHyaWgRnYdUaREDv4r/IOk/zzZ6KBEhEJM0RvVKB+aOiGAAzq37fR6TfJhxIuDndD/X888xE= 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=CW28d+71; 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="CW28d+71" 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 62BMWUtv2303568; Thu, 12 Mar 2026 12:26:15 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=al6jYWb2aZA4hmaYa ZhNzaupRDLJVh4UUYdgPwIwhk4=; b=CW28d+71SUixrGWhtyR/+mkbTEYaUnQJN JW1h4AJPfA0V7jO/EqtWUSKsifycJ7IcWdkJ84YAVOVR0KHrjmt8OkxVww/E2Kqh /dY8o57wOImH/1RvyKIAxbmx1ChW830sWGHmBGTRP9JRxgVIPLjDzEECUi3BYwIG bKph12W087SGR8GUR/mTNeHhM+c232w3iJ1nL4okfKAuaOLOiNuJqU34khvW8sRh nYmehxMwSTUVSG+zAtpz1jjGjBdGpYLEdlpOzFM2rmwAH9Sm1X91ezi6SlGoH8U8 oZbpTmZq79zfXOA6xP2WazgJnXcg6vV0LfX23lqXgLlWFtLK1G18A== 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 4cuh95tg9j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Mar 2026 12:26:14 +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 62C9KIKg008820; Thu, 12 Mar 2026 12:26:14 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4cuha72979-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Mar 2026 12:26:13 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 62CCQCha43712914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Mar 2026 12:26:12 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E9F3B2005A; Thu, 12 Mar 2026 12:26:11 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8F7982004E; Thu, 12 Mar 2026 12:26:08 +0000 (GMT) Received: from li-3f69264c-2ce6-11b2-a85c-c3f414d24014.in.ibm.com (unknown [9.109.243.201]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 12 Mar 2026 12:26:08 +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, Sayali Patil Subject: [PATCH v2 03/13] selftests/mm: fix hugetlb pathname construction in hugetlb_reparenting_test.sh Date: Thu, 12 Mar 2026 17:55:30 +0530 Message-ID: <3ab5781190ea0a6bffda2683b2ca221e0c7f6280.1773305677.git.sayalip@linux.ibm.com> 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-Spam-Details-Enc: AW1haW4tMjYwMzEyMDA5NSBTYWx0ZWRfX63TGo0ZlBIf4 Uj5aB3Zg3C5VuEGFVhlil7pvZ1a7MI2AeE1LldfqCeDsvdWJyOkzsw4ra2eiO898fsWh9mL7mC6 vrp6BKVKpfH+N4wnTX0aowytefM4mj9ElxsonGYJb9uz51+FDx7crE0vnsHiPD/f/ttibhnA1qj hzBvdDm3KkaHqdBM4gak+fzoXyHXVkRxnH7FWfJ1RW8F6OI9k+nsKjEHD1FWSrft0tTX/DGW9JZ VRAPq6wsGdT19uMcb8lon+PUBuwOAOmPdD5SrJVCGOU5+rZAt4uCcKfkY6uo3ti4XJp4toFpfvi z3ZEe922NoltA4kMWPx1CpUBFq7vmDSuHxIwyzATYl+Xei54KvWf/I5quT66ZSW370i80dAJLFr x4R7CPzy0HUSYUar1QBMUUZuiVl0Tpxr6WkkC6mqbAVzNbTAfwmFSGls/RhwBHANpD6FTNoUg47 0olZc1HV6g2LrkayHZQ== X-Authority-Analysis: v=2.4 cv=FowIPmrq c=1 sm=1 tr=0 ts=69b2b0e7 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=Ikd4Dj_1AAAA:8 a=VnNF1IyMAAAA:8 a=GZ17xiyvJlIGkQ2CLjwA:9 X-Proofpoint-GUID: 3G8cnwaJ4QaZVz4DGmqOG0_7j8k2hu3b X-Proofpoint-ORIG-GUID: G20fyj2GUhLBjWzP3YtY8JZbENDnytaE 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-03-12_01,2026-03-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 suspectscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 malwarescore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603120095 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 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 0dd31892ff67..073a71fa36b4 100755 --- a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh +++ b/tools/testing/selftests/mm/hugetlb_reparenting_test.sh @@ -46,6 +46,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 @@ -87,6 +94,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 @@ -107,11 +115,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