From nobody Tue Apr 7 18:02:30 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 B719A2E175F; Thu, 12 Mar 2026 12:26:36 +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=1773318398; cv=none; b=G3oxALzGvaGX06ehBFClI5jn1+F+Fu9h4+vDsY4r9rB4XNiJgI4zTq+GkoY5pxM6xDK3nG6F8qr23+YRBVuZblGGcwL/+Yvj2qE52ZzuTsGcS5891KK5D+06PzeDK6402LtE8/JTKQt0NPZPBKpFfBOMEnvxY6rD53AGZjLqCDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773318398; c=relaxed/simple; bh=8npSdwBfF5z5KHJQV7qTu0vgUBCcll6qvQGA36v41d0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fSIrO1tsyGrfiijb4xhvSeR/muZNrdweVqlgE61lqyxMVksRdVc6Jc9T8vltSZdbi7Uj7gy7jVrHe4d1tjQIoECYDmoPzg6QuQ00SqzIVtqvkzDlaJ4iM8fLk5nKMiRRptmGvvciGyqpPw9ZviP6ptCWFX/smTTxUV5zDmpiecw= 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=KNYT2/Rm; 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="KNYT2/Rm" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62BMWDuR2306667; Thu, 12 Mar 2026 12:26:22 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=ZjGqSi2qeZS0jr//O ksiYi0l0c78Qgoy4P0z1IMFjGg=; b=KNYT2/RmPMyq+HmukOJVbmNmoRkaLC2OO FcGudQWxSTnYA4GRCcIQ9x5Ct/WV8J4iPf3K07W0PY1RCZmRc+ELJgJPK1wRmk6d cqVe8YVdqqtR0HJ87JG5UzCNgc+2O0pnlgnYKagvtq7XZ5bnO0yHPomhMG5cHz/J jZXo/147Z95mCnYzWaIX6u+AArPydM5+e/UHlFJOWLfMh0N7PfRUvx/qLxVWgnIV 4K8twNZc/ThygXe/z4wmtoIrAJ6Uhh9RiRG2yUCC1LVOcemOEzCz63OCHZvYCXIn llcpP8TTtTnjlmJc4zUQXJYFkiPuLEpDHAn45GP/H+ERzjcWAVahQ== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4cuh96agta-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Mar 2026 12:26:21 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 62C9aRDh014797; Thu, 12 Mar 2026 12:26:21 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4cuha8a8rt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Mar 2026 12:26:21 +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 62CCQJ7q43712974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Mar 2026 12:26:19 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ECEB32004F; Thu, 12 Mar 2026 12:26:18 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E85022004D; Thu, 12 Mar 2026 12:26:15 +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:15 +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 05/13] selftests/mm: size tmpfs according to PMD page size in split_huge_page_test Date: Thu, 12 Mar 2026 17:55:32 +0530 Message-ID: <94c18dd26cf88f10b4b496cb3de08d81439a8909.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: AW1haW4tMjYwMzEyMDA5NSBTYWx0ZWRfX3aQhsvirouQL sLxYoZChXsZoC2ubR6c+B+HlrhZ3oXTkv8tGus32S9zu7Vum4H+eWQbG+ZZxym/d2Jw0BQ3Afhr G/r1lBa2gdmO1/Idw0bvNOxuHXwkYKySvcM6tQI0ShcvkMdhZd0Z75/ts02TjNQzBg0HTB5YlQz 4cntdxhHnKq15LdPJQ4FSirU8iC6yBKKbc6tx374I+OUlIiCJLt4jK1BRzSUfc2ECZJB+t0kWli 45M1Y51eh2u5ZkxPuUtdQnoWGDxLotvge87ToFUfTXa4h86K5DJ+gfiNHqewEMIoB6rv1QVWUF3 MD5xqCelw6pxR6s+k4Nid+gi48tZg42MWj/rSzs+Kpxh/om/uE0j9at8/zQ0eN4LhzaphX9oeqo 1Rbv7oIQGu43pLE8sSizudyeCVoBvKN6VRq8LSCEdSe2ts6O8rKDu4biIIg6WlgfiSfnHvOd/gR e4ho06Z01KerQi1d/sw== X-Proofpoint-ORIG-GUID: 53sx8aNK62ilLh6kD_DjwEBbUJ4YR3QW X-Authority-Analysis: v=2.4 cv=RLO+3oi+ c=1 sm=1 tr=0 ts=69b2b0ee cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=Ikd4Dj_1AAAA:8 a=VnNF1IyMAAAA:8 a=2DqBuDyFdJ_AORcY0zkA:9 X-Proofpoint-GUID: yxxACtQRrI0kzAt9OXrOCppiXWZt_nBS 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 lowpriorityscore=0 priorityscore=1501 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 bulkscore=0 adultscore=0 malwarescore=0 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 split_file_backed_thp() test mounts a tmpfs with a fixed size of "4m". This works on systems with smaller PMD page sizes, but fails on configurations where the PMD huge page size is larger (e.g. 16MB). On such systems, the fixed 4MB tmpfs is insufficient to allocate even a single PMD-sized THP, causing the test to fail. Fix this by sizing the tmpfs dynamically based on the runtime pmd_pagesize, allocating space for two PMD-sized pages. Before patch: running ./split_huge_page_test /tmp/xfs_dir_YTrI5E -------------------------------------------------- TAP version 13 1..55 ok 1 Split zero filled huge pages successful ok 2 Split huge pages to order 0 successful ok 3 Split huge pages to order 2 successful ok 4 Split huge pages to order 3 successful ok 5 Split huge pages to order 4 successful ok 6 Split huge pages to order 5 successful ok 7 Split huge pages to order 6 successful ok 8 Split huge pages to order 7 successful ok 9 Split PTE-mapped huge pages successful Please enable pr_debug in split_huge_pages_in_file() for more info. Failed to write data to testing file: Success (0) Bail out! Error occurred Planned tests !=3D run tests (55 !=3D 9) Totals: pass:9 fail:0 xfail:0 xpass:0 skip:0 error:0 [FAIL] After patch: -------------------------------------------------- running ./split_huge_page_test /tmp/xfs_dir_bMvj6o -------------------------------------------------- TAP version 13 1..55 ok 1 Split zero filled huge pages successful ok 2 Split huge pages to order 0 successful ok 3 Split huge pages to order 2 successful ok 4 Split huge pages to order 3 successful ok 5 Split huge pages to order 4 successful ok 6 Split huge pages to order 5 successful ok 7 Split huge pages to order 6 successful ok 8 Split huge pages to order 7 successful ok 9 Split PTE-mapped huge pages successful Please enable pr_debug in split_huge_pages_in_file() for more info. Please check dmesg for more information ok 10 File-backed THP split to order 0 test done Please enable pr_debug in split_huge_pages_in_file() for more info. Please check dmesg for more information ok 11 File-backed THP split to order 1 test done Please enable pr_debug in split_huge_pages_in_file() for more info. Please check dmesg for more information ok 12 File-backed THP split to order 2 test done ... ok 55 Split PMD-mapped pagecache folio to order 7 at in-folio offset 128 passed Totals: pass:55 fail:0 xfail:0 xpass:0 skip:0 error:0 [PASS] ok 1 split_huge_page_test /tmp/xfs_dir_bMvj6o Fixes: fbe37501b252 ("mm: huge_memory: debugfs for file-backed THP split") Reviewed-by: Zi Yan Signed-off-by: Sayali Patil Reviewed-by: David Hildenbrand (Arm) --- tools/testing/selftests/mm/split_huge_page_test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/test= ing/selftests/mm/split_huge_page_test.c index e0167111bdd1..57e8a1c9647a 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -484,6 +484,8 @@ static void split_file_backed_thp(int order) char tmpfs_template[] =3D "/tmp/thp_split_XXXXXX"; const char *tmpfs_loc =3D mkdtemp(tmpfs_template); char testfile[INPUT_MAX]; + unsigned long size =3D 2 * pmd_pagesize; + char opts[64]; ssize_t num_written, num_read; char *file_buf1, *file_buf2; uint64_t pgoff_start =3D 0, pgoff_end =3D 1024; @@ -503,7 +505,8 @@ static void split_file_backed_thp(int order) file_buf1[i] =3D (char)i; memset(file_buf2, 0, pmd_pagesize); =20 - status =3D mount("tmpfs", tmpfs_loc, "tmpfs", 0, "huge=3Dalways,size=3D4m= "); + snprintf(opts, sizeof(opts), "huge=3Dalways,size=3D%lu", size); + status =3D mount("tmpfs", tmpfs_loc, "tmpfs", 0, opts); =20 if (status) ksft_exit_fail_msg("Unable to create a tmpfs for testing\n"); --=20 2.52.0