From mboxrd@z Thu Jan 1 00:00:00 1970 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 7C998395AC4; Thu, 21 May 2026 06:48:39 +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=1779346120; cv=none; b=Eof+GuqqCjUPvYBp2ApDxhnuXpBHXacmknXQw2YWR7MvXsWsRwxvyD3eXllaDAj+mZ42aEoIxZ8pEszpUj9darp0Xpr/ThcmYZ9LiTqYBa0qRBOO6Ne6Ak/6sPQ1Gznb0BM6fen84lT9etlB3Jmjil58X/87bgQf82p0R3NYlDo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779346120; c=relaxed/simple; bh=Phzv6Er8wF+8uqtjbMWElkvWEYRsIQ4TqNEEPQnxkJI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ThOcYWWv2tN9Kd34LQJ1zCbqhuX44v1yLthOlzLJVUDw9vLXtgT0IyFT0nRu5Lfgtv6Fc0nUoQgla812FN0hrQzg0mFJ2is94uZm/XBhelqeLz0DeoIYQkrqwXwAm7EBtRT5En+KPUr+tqqQnUQ64Tw/WGOMlNvFtMNTQ7MRAq0= 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=D3S5yZb6; 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="D3S5yZb6" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64KJBE2b2735197; Thu, 21 May 2026 06:48:16 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=mtvzoiAxbgnkfrp6P scCj4WP0YSbVNRNiGRRDhh6oYQ=; b=D3S5yZb6D9RVZAJbTgVLjaoeF4LmeNTY2 jFy3mg3DNVsQpTX3FPSETGGUzBX51j74CAwd63gsLvcn/hNlbVE7b8pi3sKWz4jo B5/xj+xgH1D1omtIg03N1apo5l+IWZwuaC2tYgS4DoFskzTobQ65x4N6356dDFD4 nATYohC2tya4N+QN/DqhTdgniffLWl2RS8Y/5UytL91dZ0OXDY5qGnWf41cL13eN 4JBXnUDGn4CM+CYMivOhY33W4qUDJi1B4EPE1IGK6iY0yMUTr55axX5QsMauUnYu JUEuoMPT2QYlOPbKIvy6AgQ2TaxvTYm5/RpBnJLTsHKrq2fLvH5Kg== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4e6h88mcd8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 May 2026 06:48:15 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 64L6d6hQ018345; Thu, 21 May 2026 06:48:15 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4e75kyajdn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 May 2026 06:48:15 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 64L6mBQj49414406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 May 2026 06:48:11 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8002E2004D; Thu, 21 May 2026 06:48:11 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5FCBE20040; Thu, 21 May 2026 06:48:08 +0000 (GMT) Received: from li-3f69264c-2ce6-11b2-a85c-c3f414d24014.bl1-in.ibm.com (unknown [9.123.3.209]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 21 May 2026 06:48: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, Miaohe Lin , Venkat Rao Bagalkote , Sayali Patil Subject: [PATCH v7 06/13] selftests/mm: size tmpfs according to PMD page size in split_huge_page_test Date: Thu, 21 May 2026 12:17:46 +0530 Message-ID: <33e1bc10753fe82d1217613d8cd496020778cf2b.1779296493.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: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-ORIG-GUID: mDMVzFjnYJc1JdZPKPQtNX6Etc6MavDN X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIxMDA2MiBTYWx0ZWRfX6cMxuM7nd47K MsrK6X7vjHNPqH/gfxfH1Br1ClZCnimb+XXLJI+6DaCmTzDuhUpQPuUbtmh7yBcFm7AC/Hm4ZV6 iqVKgBOiYynV0IIjE1mJS1KeGf9pIAqB1Nimd4Z8fX+AHkkohtQJRht0OVp35avDt2I9gBVcaei z1tiYB7Jt9CrmO16I2AXvjdf6CvCUxSVV0fKOKWB3qGp2TN/P69tn6OjUPsUs/H+RxyP5O7itU6 BGszVYp53aOgnRhRhvM3fVY70qP89+vKKvuAOMHxmPzDXiELNhqlUyWay0Mnoulag4x8nc1JtAf ovpEsgiha158K1wVMM35sTycyapJXw4cmptFMxQQ1+c/vKEjS8eMPZ11jP7inVgML8PWmHwSnAE vMdY4Hfwt4e8xm5NNTYVw9JSPScbCQ0JG5qNn9OkVOkZ9quuBneKaZdcBCOJam3yA6WacKukz8d EL5WN4ns/byyFIcmBFw== X-Proofpoint-GUID: 7OsTwujtcS76igdtvXCRZzwfhYTlJYbk X-Authority-Analysis: v=2.4 cv=apyCzyZV c=1 sm=1 tr=0 ts=6a0eaab0 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=Ikd4Dj_1AAAA:8 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=2DqBuDyFdJ_AORcY0zkA:9 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-05-20_03,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 phishscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605210062 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 != run tests (55 != 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 Reviewed-by: David Hildenbrand (Arm) Tested-by: Venkat Rao Bagalkote Signed-off-by: Sayali Patil --- 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/testing/selftests/mm/split_huge_page_test.c index 50c80ceb4988..4066de6e8ae0 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -470,6 +470,8 @@ static void split_file_backed_thp(int order) char tmpfs_template[] = "/tmp/thp_split_XXXXXX"; const char *tmpfs_loc = mkdtemp(tmpfs_template); char testfile[INPUT_MAX]; + unsigned long size = 2 * pmd_pagesize; + char opts[64]; ssize_t num_written, num_read; char *file_buf1, *file_buf2; uint64_t pgoff_start = 0, pgoff_end = 1024; @@ -489,7 +491,8 @@ static void split_file_backed_thp(int order) file_buf1[i] = (char)i; memset(file_buf2, 0, pmd_pagesize); - status = mount("tmpfs", tmpfs_loc, "tmpfs", 0, "huge=always,size=4m"); + snprintf(opts, sizeof(opts), "huge=always,size=%lu", size); + status = mount("tmpfs", tmpfs_loc, "tmpfs", 0, opts); if (status) ksft_exit_fail_msg("Unable to create a tmpfs for testing\n"); -- 2.52.0