From patchwork Mon Jan 6 16:55:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 13927704 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E829E77198 for ; Mon, 6 Jan 2025 16:59:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EDE4A6B00A5; Mon, 6 Jan 2025 11:59:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E66D56B00A6; Mon, 6 Jan 2025 11:59:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C942F6B00A7; Mon, 6 Jan 2025 11:59:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A7A186B00A5 for ; Mon, 6 Jan 2025 11:59:13 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 59B35C0110 for ; Mon, 6 Jan 2025 16:59:13 +0000 (UTC) X-FDA: 82977637386.16.E5CEFD5 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2061.outbound.protection.outlook.com [40.107.96.61]) by imf05.hostedemail.com (Postfix) with ESMTP id 955EC100006 for ; Mon, 6 Jan 2025 16:59:10 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=mVh1w725; spf=pass (imf05.hostedemail.com: domain of ziy@nvidia.com designates 40.107.96.61 as permitted sender) smtp.mailfrom=ziy@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736182750; a=rsa-sha256; cv=pass; b=7f4vTcKZN3GAVL3+GehNuY1J6Xd/phGAZfWpJcdbM9eMk+eNNVDnNUJ4NhyxRKqESM2Lfb ckpaQTXsGY6Ji/6RhVNlFck5k4a/1z/lJuCWZJk79FD+Sn/RnPQ8OxdOMUCe3igpd8Lqb2 qi/TGEousbkSEve1ggpJcYTAYlsDWLU= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=mVh1w725; spf=pass (imf05.hostedemail.com: domain of ziy@nvidia.com designates 40.107.96.61 as permitted sender) smtp.mailfrom=ziy@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736182750; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7vfodItUcrcyLrOMU+QPVr1fQyMNwn6ddi+gcaz99x8=; b=6jsuLVJ5noknCH+yRBgjEoxfWAOT98vFja8+DEj/qsxUYp3CtnSPLSfJqkEl+nF5w2921k XIiAKIO7r8r7cPP8ZslwWPMpyt9tJuclSsa0IslmTgF4z8xaBg90TbHeuMk3ZXehvH916l SMykDORUNAU38ZJ3jS5rQPtooBP9wRU= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hnuQa55IlJjKzRhfJnlWdEdpTaHswO1WQ0MyCib7jpMWqHHAlOFEXWv0eGEjEEa+3U04BRRAzaHpJJBU7P3FdbHKVfxW+DgyHqYu8ZUEUgg4qQ5hueq/7Fm6hLnvK/QbdQF1f4DY01D40rZ2C6hLP498dOyXCMV/zpPW80A0f4BeTmLOOI3n7Xp4oxEANcQldSFeoWSPK0qZtpvRFtgUDSKRkGGlNDIOOtgJgxKFf40uLhMiJBVuTkSTw8vNC2vDvjUNzRuK7hC3eHU3mvY6dEQPLrmm9pvrIQxmZ1Mcqc7JIWzcxZS3b7JDutrVZXxO7a10m+b6ubOn4n75yw2kPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7vfodItUcrcyLrOMU+QPVr1fQyMNwn6ddi+gcaz99x8=; b=o2N1owjpYRBm+xS5Hb65Tph9kXsaaTpyFz+MpCXy4rTHPCSeNb9d9m68lrZPHxveXTKjsbgSsf+aHPg16G2H8wIWQSvQwOrg5a4lPtWwIlfsAiFg8eUlc/oONanhOeGW1oMjDOk3t2ec8eJ2kRIBFUDzQKNDyEuVssG6XzcpqHiRR6E/HvmbDdyvDfyhlNL/l5YOFT3TOJD/N3t3diCYBD97pLs13wPkxICgut0rdV1g21zAv9wJ6+5rqg1jQLOmeR0pvisKeXd0U5eRtBkAwk/EiuIKgbV8sCjeX8HYpoC2HPm+mKNBsbHMSKMdu2xrDDap/Ggw+H3GZou4fh5mRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7vfodItUcrcyLrOMU+QPVr1fQyMNwn6ddi+gcaz99x8=; b=mVh1w725mam9Jyhv4hHUb77GDc9OxmSqI98IbcSlEZIcmb8eY0l+DlxYBNz5j+1isH8UTB4XWyinKlzAh1zPpjyBQQ07MobxHXsP7Rq8+IimAVu32B+dBkXUTHr0kPPF/CQxSUbK6jXfEDugRp7k8+EEJbPHYfU3wVn1g3xTtnHCydB9LUJbQZnKZ2f79PJSMarIcRQrCRIXRVpGZRd5KSNgVUNHbGzqR0o5WyP+mIJqmrk7x0fBzP554Y0HZVpnAKP/d/M9vZ7TUhxWLmBgOQdX8Pyy2PL/6GNfhCkywCJeBoOEGVyE9bhfRTlsqm1rsXVX7XU5Kg1QwG942gkJpA== Received: from DS7PR12MB9473.namprd12.prod.outlook.com (2603:10b6:8:252::5) by PH7PR12MB6634.namprd12.prod.outlook.com (2603:10b6:510:211::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.17; Mon, 6 Jan 2025 16:55:34 +0000 Received: from DS7PR12MB9473.namprd12.prod.outlook.com ([fe80::5189:ecec:d84a:133a]) by DS7PR12MB9473.namprd12.prod.outlook.com ([fe80::5189:ecec:d84a:133a%3]) with mapi id 15.20.8314.018; Mon, 6 Jan 2025 16:55:34 +0000 From: Zi Yan To: linux-mm@kvack.org, "Kirill A . Shutemov" , "Matthew Wilcox (Oracle)" Cc: Ryan Roberts , Hugh Dickins , David Hildenbrand , Yang Shi , Miaohe Lin , Kefeng Wang , Yu Zhao , John Hubbard , linux-kernel@vger.kernel.org, Zi Yan Subject: [PATCH v4 10/10] selftests/mm: add tests for folio_split(), buddy allocator like split. Date: Mon, 6 Jan 2025 11:55:13 -0500 Message-ID: <20250106165513.104899-11-ziy@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250106165513.104899-1-ziy@nvidia.com> References: <20250106165513.104899-1-ziy@nvidia.com> X-ClientProxiedBy: BL1PR13CA0107.namprd13.prod.outlook.com (2603:10b6:208:2b9::22) To DS7PR12MB9473.namprd12.prod.outlook.com (2603:10b6:8:252::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR12MB9473:EE_|PH7PR12MB6634:EE_ X-MS-Office365-Filtering-Correlation-Id: 4eeac6b7-9412-472c-b56a-08dd2e72effb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|376014|1800799024; X-Microsoft-Antispam-Message-Info: ZVOy/AeOm0/S/Gp6gXaU8sv6onEPQLrByenWjq0ay54zck3wRyuLYWKZMzFRNCK7O1pRKMx4MKd8XweCwc/0bwbdLUM0l3MOrH9MwA+FBQGhVCPNRGhTmF157omlPC57TUM9vFxg1B+2UCbm+mBDNeEyfGVEi8kkEcw1gzhrfqZ5iR6eE3Q3MF9axPRLbZK17bJmN3eSwrzx4x/v2JbK/pGIzuLyRtEORgfFHtw7z6UnxTQLGbFSTtES7ZDQp9fsDTMUfQUSg6rmCWYToOuoNQxRL/MEEElRscwPBgOsa5fkHgquMqyIrj+Xw2YN++86hQr19a7i70of5vlkhh9StYPLyDPXAlrRCXDYjclGG6NQHDO/hYcoqD0QJFyNojNn0bd7/gxFdGEVApY2zMY4iZgRi7OmbqQDU1Mg+Y+lElOctZA5CcGZdDaJN7I7Aaiztn9n3f5ZX/P8ijTsR5VGus0yJC9aXVl8Z3GK/xehbP0kA12ukWj3mXROiPJwCeJw2P4Sc7Qd6eQDiOdhKFKRu8OcoWc0ojNEO17FSisO0oN5hPzljoveYT/NhhanvZhBaNBQWCf5MkTpbgZ1kKJQoRG6LRwdxElWDKC68W1i71WPgQRTC9udy166iinKkFwAfL24JIDKvCN1J5LncFGQOhkvETS0XxXrQoC9FeqeABGuawICIF+IX+VC6LZOdtc4riKg3HAGujga5WSA9tpOJbYVnvw6efoX0OWlr53v01LOkR8tM6VflJKHWvxt9j0gxHeXNybUEOFP30RrBWPj3tj1UoKpxwFlJTfgen3G05XqwFuJG7SlsobF9AuJtLp1OwBCOGcuu+bP8ocssrDnPHyRRDTMXtHLeZsznJp1DrGBX4DNfIKkqtVM0dfIwoZ+V3T7oWxikZqROgm6ZmNXq0/QwWmJBFzco6r0LJKX2ZRV/q/46qcot/j9yC2lkrDrogg8K741AGK+2+0u+Y68HTZVapCDT5Y8ce01xmorb819/G4glrBSGJEIA3I0LNg0vaNAFHfpT4UcL0eUcQ9htY36bZfqtGGzKdMaKiQqwWSviQVlypksRbQXM/qG3CAW2OYodENnrSoECinWFuKmFUyKa7NCyXsG7iCmJASklw+cciJS6el5S5fd9lKKn2Jar4NYU+Ok4qO29D4IDNgN870rNAqLHZ5ZfoarUrHsauIWMiWdA+K7AC/mZj5WpCr9khz+Ou0KQjDuHiG4lGjGl5/baJd4y4FJ1q/Gd4hssde6Ki9D7OMo5Pj5NodqypE0EVs7LpIDTivg4XkMSFqfbyffMEZqdC8DVP81miNxnMUWxvqUoVAFsEYNFMaj3UAHu5tIlxZj4UFjOrOEVSE6j72SfCM/Nmk2iXWmbC4a3mcyTxJO811pMkBCL22X0eUs X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB9473.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(376014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GfRaUAkp1c1afFVyqztfF2sCaScMNJ5z7Hb0rcOrvko+bql+oG0Vav0IRQ1wB5pWlH4qR5Jy+RS3bKwQtymAgfvUzD6LGzwYOaqlbFc6FKS5ooseZgzbGmzXWnkXYr2lBWiHJ+j6H/oUbGWxSXOZWXvqUq/7J16BeaFliPumpzBMHuXy+PHgPDxLWUXqesxyQ7EDqfX89frZPHnmptVg2ZPtFCQfrFEtFrlHb0Vyy8uzmBvILzNEz8/3yeECEDazE7qx9rmJnb36ZGBvsKFxkib0KMdD+JTiu65Yl8aeeCKEeIH3NcAr4pmzDBCuVj6bu+yGjtLtwr1d8J9jARchX9JDHLiOo1mS56AeSUkqb0A6kX2EuN005sy3GegIA1Le3n6amWi+xHNeVVFNYfxon0C5lT+VQv8yyDMefNp72fWgig77Ctt6UsfeQ82gXajTQGrC9dRaF7PxHjwCJaLnL4CRWqn+LwPt9sSQOw8r9/yxFwZK5xSI2IptW7QotGdYgD8KUFR3maHrsAYwFLqFJUdwlh2y3zgm31JfaI673IxuSK143HF2+Fkhg0SgI5aMVsAifwVg75KWCuKDqzBAhIdAzWw/TDwaD7intvbyKPbGREq4CSh+Ey4+kt+4Q+KyQ4kfNGkIa5+4ar6jC06qZ4+GNcPI66Kt9ceJUN3u5joydw7YJI+a4DgyLV8PUYqz6sJapJc6K98fVyN4SoXAMmDmkS5kEpL7wLenrOR80JHhI84iHYsNVXfgPSglfiRxvy2tHrZ/Adl4T+oZenYQTdYGwMN+pWBb7Vifatkbe2esim5g4O7mQgfHRFLRW4KrgaVsCNF/CXtvQqfehCrNpJfqNqO47i5EKbf5B5ZKdpbKE/SoKzl0pzEQR5fmtvrYgGvhVbn6oymon42pd92f6EcXQuyfMRAjbEY0VGMyGumUjUj5QyGCPCYAYn1lPyr/u9vc6KoE352jCJQY9oHuQFAjzLt7/HbOSRX98KHsmRnsOj1fuUytoF2XO7dvY629D7aFTEv3nzoEbWpKg9K1+oTKQiKPKRnEWieUhhsS4TFNL5i38QlloLeGpgpUJwNbCGqKgEnzl9P96dSdyMBPw5QP7/p5odwnY5H0Zel6HzPXxs6o8f3K7vk60rGYSbfp42DbeDliiaStgf2v0SDgu+zde+qv8Tzmhi5x3W7lJbwowhWdPUAdFwESQj0Iyd75Z1vNDQ836ZOXARHV1CRmJY4XQjybEIMRbvOZy1vnH6oYf4gyO/tAe45oN8/+wy6bclKojdvUshWtDZBn1SGNRkLfcTjUKa/gVMPfzG8EWLkLhRofy0p6/NnghQQPXOm4QrPeLKBJl6gkWmoD/LpBepAHKUpWkUcHQHfNQWa+J3JEfGq0VY4vmapd4CMeYMokvnuxZXQGakBWTgLGFmXPWGpn3fntceNcA1iO5on3Ba9jEBg38SngmXxvQIirZkS4YbwGcZx9u1F6ec2QRsnc94nx4aXPpSEhf5wdzkBChEZhHmF1AgUyZCFgRoH7vZbK6RKVrN3JAwqbHThEys1Cowbyuq8SQOyqZg/gytmD+KBrlrSgfdg76BEdV8/XSJen X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4eeac6b7-9412-472c-b56a-08dd2e72effb X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB9473.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2025 16:55:34.4870 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5XDjjv8x84r+sE9A9jCFVWjS7KoEo4/qE2ZTWA+14xAKUOeavbCBtra+Fw+6beT8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6634 X-Rspamd-Queue-Id: 955EC100006 X-Stat-Signature: bqoigf67rfqjn4dppxbhhqoqrapq97n9 X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1736182750-965194 X-HE-Meta: U2FsdGVkX1+nBRnIuthZ2iGaiLwDz9MP/Dq6ED7OuuL39V3zx+KHJofNJVR2jyocMDp1VQ5tQ/eakEhfA1Y4C+iEPrSKWNLLigfaLrwO7oaPMVFtXUwtOoBQKg7aqF9/7ukYMerIYuxGHIq4oousTXP+pgNanz9kkCB6ZhUjsPyqksYqKoSOmQIIw/eA9wIhWPnVcmjAjIQ8mnbNyYGzrxExlvl8/AEyFlphbzdwX2+IYNsFHgN4fuezwGlzofWU8Tfq6pXOs46c1dCX16y5o0BBmizo1IjTRViMNf7KD7s+tnX+rJ41KXdwJxbvs0o5g0roFZ1arL+JALSWtpIVr080OvjLqyeQBmBIXKIlBPH4d0JnFi7a1rmuaPjnUQlFn4FCaFZt/I3vPgWHnQGvmdciiAfMLMsxQQNVc95/FOEqet/BmyHa8ZQosAHdqAYh1GB9T3uYrNEbEZjTYPj+jVzEqtFGOCgAaJnUfNC8aaIWAjtqn4Ddjk76GwTHjBmkqxy7rMCRT781JnB8Xk2qvqaSw1lTlgv7ZF80AMdsaIDxq8dGnhuG8CGbENkphHH5ALNMSo3AQWbDnB4+ycdrNON/HFVzxl0s50SH6cjStNNww5Vcj+TeGok95qMTLEwEGNzxj60k6kjKGRT91TUcyGflNEgTcnj3zUsLZzIQdtwHHbYqQCn3FWZj8u85e1A+k/Zb24dhgil0wgVPdl+D0E85k9a1EKVxuEOnztAkLoe0kKxKUALl+A/vPbmlwUcmG85ZXMUg9c7yibhLNz/v0dL6IXRf9p6O2dCM4XsF65nRpvmhuom8VOD3QfjfQ4+1Lf2oYJ7281AK9nwYokJtSbwCe29/rxusORZJUFV0rkzfBJ4+4y9BIpdiicplcKALe2f6kzsARlUqKq+3MTysqrMbLathq9rMESyneAHBOX33hBkqZaad3H1wE5nzSW/ZuzFABIHIm/Z5kNY14d4 civzOssS ksTjK/s3fCBT8HGuoLt2njpEVJghHloszI2AIPOjKgObNTLKWJXasZRm+JwXN8xmhjTRSObcL2YsPCfSpQ4lcSD5OXMxMlKL/bE86cNA2ZRYSJktDDI7uRIbLJ7P83BrCcHkf9OVDhRsJt/90bOQ2AFfOBeDXJKAOPnwjSl1awvdGxDMaZebBs6McyDZuxrePSlc3/C/TmK7+hQo+N4ve2RRW5v4/i10pFcGny1CFNdC7W2+j+FMIWega2/wegjPfKjr20uCx7IgDj6o0ZP+bdex16srIB7o64pcso6lQG4gKPQ2urgFuY7/z0qyFdwfCe0RjD3bNlMPIhK2nGUrI0RJysjwwGK02m5UDxoUZbQGy9X2vURWOb+OS7YC0DNiq3O2Q+aG5vNbPrGM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: It splits page cache folios to orders from 0 to 8 at different in-folio offset. Signed-off-by: Zi Yan --- .../selftests/mm/split_huge_page_test.c | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 5bb159ebc83d..1af8d6fa4465 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -420,7 +421,8 @@ int create_pagecache_thp_and_fd(const char *testfile, size_t fd_size, int *fd, return -1; } -void split_thp_in_pagecache_to_order(size_t fd_size, int order, const char *fs_loc) +void split_thp_in_pagecache_to_order_at(size_t fd_size, const char *fs_loc, + int order, int offset) { int fd; char *addr; @@ -438,7 +440,12 @@ void split_thp_in_pagecache_to_order(size_t fd_size, int order, const char *fs_l return; err = 0; - write_debugfs(PID_FMT, getpid(), (uint64_t)addr, (uint64_t)addr + fd_size, order); + if (offset == -1) + write_debugfs(PID_FMT, getpid(), (uint64_t)addr, + (uint64_t)addr + fd_size, order); + else + write_debugfs(PID_FMT, getpid(), (uint64_t)addr, + (uint64_t)addr + fd_size, order, offset); for (i = 0; i < fd_size; i++) if (*(addr + i) != (char)i) { @@ -458,8 +465,8 @@ void split_thp_in_pagecache_to_order(size_t fd_size, int order, const char *fs_l close(fd); unlink(testfile); if (err) - ksft_exit_fail_msg("Split PMD-mapped pagecache folio to order %d failed\n", order); - ksft_test_result_pass("Split PMD-mapped pagecache folio to order %d passed\n", order); + ksft_exit_fail_msg("Split PMD-mapped pagecache folio to order %d at in-folio offset %d failed\n", order, offset); + ksft_test_result_pass("Split PMD-mapped pagecache folio to order %d at in-folio offset %d passed\n", order, offset); } int main(int argc, char **argv) @@ -470,6 +477,7 @@ int main(int argc, char **argv) char fs_loc_template[] = "/tmp/thp_fs_XXXXXX"; const char *fs_loc; bool created_tmp; + int offset; ksft_print_header(); @@ -481,7 +489,7 @@ int main(int argc, char **argv) if (argc > 1) optional_xfs_path = argv[1]; - ksft_set_plan(1+9+2+9); + ksft_set_plan(1+8+2+9+8*4+2); pagesize = getpagesize(); pageshift = ffs(pagesize) - 1; @@ -494,7 +502,8 @@ int main(int argc, char **argv) split_pmd_zero_pages(); for (i = 0; i < 9; i++) - split_pmd_thp_to_order(i); + if (i != 1) + split_pmd_thp_to_order(i); split_pte_mapped_thp(); split_file_backed_thp(); @@ -502,7 +511,13 @@ int main(int argc, char **argv) created_tmp = prepare_thp_fs(optional_xfs_path, fs_loc_template, &fs_loc); for (i = 8; i >= 0; i--) - split_thp_in_pagecache_to_order(fd_size, i, fs_loc); + split_thp_in_pagecache_to_order_at(fd_size, fs_loc, i, -1); + + for (i = 0; i < 9; i++) + for (offset = 0; + offset < pmd_pagesize / pagesize; + offset += MAX(pmd_pagesize / pagesize / 4, 1 << i)) + split_thp_in_pagecache_to_order_at(fd_size, fs_loc, i, offset); cleanup_thp_fs(fs_loc, created_tmp); ksft_finished();