From mboxrd@z Thu Jan 1 00:00:00 1970 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 6C562C3DA59 for ; Mon, 22 Jul 2024 09:13:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0A9B6B0082; Mon, 22 Jul 2024 05:13:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB9EF6B0083; Mon, 22 Jul 2024 05:13:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5AEC6B0085; Mon, 22 Jul 2024 05:13:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 986396B0082 for ; Mon, 22 Jul 2024 05:13:30 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1C4E041600 for ; Mon, 22 Jul 2024 09:13:30 +0000 (UTC) X-FDA: 82366825380.24.A5F0DE7 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by imf20.hostedemail.com (Postfix) with ESMTP id E9B3A1C001C for ; Mon, 22 Jul 2024 09:13:24 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=eIVsjJfr; spf=pass (imf20.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.12 as permitted sender) smtp.mailfrom=da.gomez@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721639545; 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=fL649yRlqma+1qKxqnlEH6xA44iNIiPZSzHqaJsKH3E=; b=pd0BHeS13AKeTt8uxTZmpk2FEPFbFo0ky16F0OUF4JVc6hqJ3v7IXOY8cvIOqK8/ozbobx 8xMq1XXieP8w7sBVnqQBlxV1UQmSLBV78ACRZm79qFID6kBlMRW+tNtsPaPE2MN/08Rq8u D1Sd6LgCtcVBnDhXTeNxYDz3+rsL6Fk= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=eIVsjJfr; spf=pass (imf20.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.12 as permitted sender) smtp.mailfrom=da.gomez@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721639545; a=rsa-sha256; cv=none; b=y3NTteY59QIQBHjqZ/NSqiLvLQjv0IM/w3fy6poQSQAb3YSBkVoYtAEkosGmnlW2R/TFRC BFAFV1gnP602Uf64OeI+TbwISkKxI1EJ0aOauN2fyphNK9RwpwV+NSAmjRp3ZXN/zOSQt1 a8T59UFLWvFigfqEih+/cl8HtjBD9Zw= Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240722091322euoutp0256383260d658c7436139635912817c33~kfhjI1CBs2475624756euoutp02x for ; Mon, 22 Jul 2024 09:13:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240722091322euoutp0256383260d658c7436139635912817c33~kfhjI1CBs2475624756euoutp02x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1721639602; bh=fL649yRlqma+1qKxqnlEH6xA44iNIiPZSzHqaJsKH3E=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=eIVsjJfrXMrewZDrCCafCvNKQSE24C6XA39ojhsYhh9yC8OJz7mlyq9ajRIFE2nPp MeswvuKP2nnu5fmktem5oATQjLqdn0wPZk6XAomNofLJcuaMQkQYstAodQpJ/9qlDZ p2VRvhcjSvP+t6rOeAvBclxi134yB9wrCrYBv8w0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240722091322eucas1p15e4f88f8c31414c3b409c98f35d87b29~kfhixPE0n1112411124eucas1p1F; Mon, 22 Jul 2024 09:13:22 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 28.6A.09624.1B22E966; Mon, 22 Jul 2024 10:13:21 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240722091321eucas1p1c2bf23fbaef130ec7aaa9a258767b06c~kfhiQMR3j0678906789eucas1p1u; Mon, 22 Jul 2024 09:13:21 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240722091321eusmtrp2f2d39bdd5f1a83306e1d45fcc93e57f2~kfhiPT0dY1641716417eusmtrp2m; Mon, 22 Jul 2024 09:13:21 +0000 (GMT) X-AuditID: cbfec7f2-bfbff70000002598-04-669e22b117ab Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id DC.8E.09010.1B22E966; Mon, 22 Jul 2024 10:13:21 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240722091321eusmtip24f5a3d35c16981971e3844584ac47830~kfhh97jT43119631196eusmtip2B; Mon, 22 Jul 2024 09:13:21 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 22 Jul 2024 10:13:20 +0100 Received: from CAMSVWEXC02.scsc.local ([::1]) by CAMSVWEXC02.scsc.local ([fe80::3c08:6c51:fa0a:6384%13]) with mapi id 15.00.1497.012; Mon, 22 Jul 2024 10:13:20 +0100 From: Daniel Gomez To: Ryan Roberts CC: Andrew Morton , Hugh Dickins , Jonathan Corbet , "Matthew Wilcox (Oracle)" , David Hildenbrand , "Barry Song" , Lance Yang , Baolin Wang , Gavin Shan , Pankaj Raghav , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [RFC PATCH v1 3/4] mm: Override mTHP "enabled" defaults at kernel cmdline Thread-Topic: [RFC PATCH v1 3/4] mm: Override mTHP "enabled" defaults at kernel cmdline Thread-Index: AQHa2BkHvPb5vL5oYUaDGeyhE1sit7ICbdOA Date: Mon, 22 Jul 2024 09:13:20 +0000 Message-ID: In-Reply-To: <20240717071257.4141363-4-ryan.roberts@arm.com> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [106.110.32.67] Content-Type: text/plain; charset="us-ascii" Content-ID: <474A2AE92269224E9E597995E77FDFBA@scsc.local> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOKsWRmVeSWpSXmKPExsWy7djP87oblealGWy7a2wxZ/0aNosnh3qZ Lf7vPcZo8eRAO6PF1/W/mC1e7trGZPH0Ux+LxaLfxhZnXn5msbi8aw6bxb01/1ktenZPZbT4 /WMOmwOvx5p5axg9ds66y+6xYFOpx+YVWh6bVnWyeWz6NInd48SM3yweOx9aeizum8zqcXal o8f7fVfZPD5vkgvgieKySUnNySxLLdK3S+DKONV2m6Vgj2nF1Qd8DYzNOl2MnBwSAiYS7RPa mboYuTiEBFYwSjy+dokFwvn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qMRcVJwIA0fXj+AUEAAA= X-CMS-MailID: 20240722091321eucas1p1c2bf23fbaef130ec7aaa9a258767b06c X-Msg-Generator: CA X-RootMTR: 20240717071315eucas1p199a8b4a7134ecf38255a721432e1b65b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240717071315eucas1p199a8b4a7134ecf38255a721432e1b65b References: <20240717071257.4141363-1-ryan.roberts@arm.com> <20240717071257.4141363-4-ryan.roberts@arm.com> X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E9B3A1C001C X-Stat-Signature: xns7xwu45w39radnmeb7nm6aa8iq5jud X-Rspam-User: X-HE-Tag: 1721639604-242576 X-HE-Meta: U2FsdGVkX19kemnyem+AeaqfvphzZPFqBQpiKG3Wacr6XTSViipB/gDAAxOn0TzITZEgT4ESZeyHlj5rFMabH4NqEs335qzb/uQ63F5OOjR5wdam4gwRtaZHz5ZYVq1psgRpbBaUeY/SIiB3v+6OGGlR/uJfUxdD6wCTdJLP/y+eEFrHWOnt4Z5SHJL7+UMj5sACcdli/db6GNkCnY4yPf8Bh5TR2BYJyGG2LxLO1RQwUbULzEajmihakoGZerkm9N4Yv9CyNiM+ZHrxgcKaiVJoBuNElU1JhDGLMo6uA8NwFUJXunp3JdhN3j5nRaebU2Bnjj8r7i3scX/JYfvttyGwFVjXMJpNe/c5ZlgFnSU4jB6Dg3YcjEChpCA3JAGpByBB6TfRO9aZu3sbdhCVuXtFEE/CZrqxx3j5Yjv02ayPm6ifzAAceD1iCHNRZ9PTRC24TQXm2pDz0RQU2sa4mfggtcXWP/chDfTCQHpxXUPHn57BGbezloXluD7FbJcYTqo+LnQ0uMvA2t0KCU1jTKglh0PiDydCgX6RA/hEVfsy1pP93jIY1ynLPOm8RkwiF7gMwBZb6mHUU8E/xI88Db2rhwQiA5VHwz9PvOZ9bnYECSUxdUwpBpD9fTWOya+2mu3ACoqCDPNSltQHG9CRghfs/U+BtMjIYIUNzafSYrwmAcMIZCvTKEwD3vjzN8UZqHbHZzKqH93Ov3rgE8tu68XcUw0dcfeadn0mXvMriLUVpzxcQKs9jVgw9jG4rMpbG3lJC1tJYN5V5m1TiLB15ocgIDOblH+gvCSzcbfDEcfBR3BM1z4RBpG6OBjqOnPk4zjd8lQ1I5QDu7uvjzYvLs+jFHmi0V2OBZIN3EEUu0XqxgqStLb/DUWT51Ay0oTmDtlCC9KIvf94nElLQ4ffhDjOd8wHsSX2KX071a6Esy8Me6fGgm8yDllAytLV/LT/getgsEbGG0xrGuIo3B2 NW6tdafE Jeo8LAFArtk7YVXKyflNe4+XvyPFLW8f6M8N9mHoVbRl9yAb9HwrwkU0ozq4E9Ekeccg381QB9c+0XhRGwkIg4ySHnpVnZ+AA9QUcEnUb3j631mI4Xv0HzanepXMBFjGyy7gBwWG4DwH38hrEofp6ty1l90wisW0qIM64bG/IV37K8fbPQbxpjSa0z31fHBxs1usv 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: On Wed, Jul 17, 2024 at 08:12:55AM GMT, Ryan Roberts wrote: > Add thp_anon=3D cmdline parameter to allow specifying the default > enablement of each supported anon THP size. The parameter accepts the > following format and can be provided multiple times to configure each > size: >=20 > thp_anon=3D[KMG]: Minor suggestion. Should this be renamed to hp_anon=3D or hugepages_anon=3D= instead? This would align with the values under /sys/kernel/mm/transparent_hugepage/ hugepages-*kB. >=20 > See Documentation/admin-guide/mm/transhuge.rst for more details. >=20 > Configuring the defaults at boot time is useful to allow early user > space to take advantage of mTHP before its been configured through > sysfs. >=20 > Signed-off-by: Ryan Roberts > --- > .../admin-guide/kernel-parameters.txt | 8 +++ > Documentation/admin-guide/mm/transhuge.rst | 26 +++++++-- > mm/huge_memory.c | 55 ++++++++++++++++++- > 3 files changed, 82 insertions(+), 7 deletions(-) >=20 > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentat= ion/admin-guide/kernel-parameters.txt > index bc55fb55cd26..48443ad12e3f 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -6592,6 +6592,14 @@ > : poll all this frequency > 0: no polling (default) > =20 > + thp_anon=3D [KNL] > + Format: [KMG]:always|madvise|never|inherit > + Can be used to control the default behavior of the > + system with respect to anonymous transparent hugepages. > + Can be used multiple times for multiple anon THP sizes. > + See Documentation/admin-guide/mm/transhuge.rst for more > + details. > + > threadirqs [KNL,EARLY] > Force threading of all interrupt handlers except those > marked explicitly IRQF_NO_THREAD. > diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/a= dmin-guide/mm/transhuge.rst > index 1aaf8e3a0b5a..f53d43d986e2 100644 > --- a/Documentation/admin-guide/mm/transhuge.rst > +++ b/Documentation/admin-guide/mm/transhuge.rst > @@ -311,13 +311,27 @@ performance. > Note that any changes to the allowed set of sizes only applies to future > file-backed THP allocations. > =20 > -Boot parameter > -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > +Boot parameters > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =20 > -You can change the sysfs boot time defaults of Transparent Hugepage > -Support by passing the parameter ``transparent_hugepage=3Dalways`` or > -``transparent_hugepage=3Dmadvise`` or ``transparent_hugepage=3Dnever`` > -to the kernel command line. > +You can change the sysfs boot time default for the top-level "enabled" > +control by passing the parameter ``transparent_hugepage=3Dalways`` or > +``transparent_hugepage=3Dmadvise`` or ``transparent_hugepage=3Dnever`` t= o the > +kernel command line. > + > +Alternatively, each supported anonymous THP size can be controlled by > +passing ``thp_anon=3D[KMG]:``, where ```` is the THP = size > +and ```` is one of ``always``, ``madvise``, ``never`` or > +``inherit``. > + > +For example, the following will set 64K THP to ``always``:: > + > + thp_anon=3D64K:always > + > +``thp_anon=3D`` may be specified multiple times to configure all THP siz= es as > +required. If ``thp_anon=3D`` is specified at least once, any anon THP si= zes > +not explicitly configured on the command line are implicitly set to > +``never``. > =20 > Hugepages in tmpfs/shmem > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index 4249c0bc9388..794d2790d90d 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -82,6 +82,7 @@ unsigned long huge_anon_orders_madvise __read_mostly; > unsigned long huge_anon_orders_inherit __read_mostly; > unsigned long huge_file_orders_always __read_mostly; > int huge_file_exec_order __read_mostly =3D -1; > +static bool anon_orders_configured; > =20 > unsigned long __thp_vma_allowable_orders(struct vm_area_struct *vma, > unsigned long vm_flags, > @@ -763,7 +764,10 @@ static int __init hugepage_init_sysfs(struct kobject= **hugepage_kobj) > * disable all other sizes. powerpc's PMD_ORDER isn't a compile-time > * constant so we have to do this here. > */ > - huge_anon_orders_inherit =3D BIT(PMD_ORDER); > + if (!anon_orders_configured) { > + huge_anon_orders_inherit =3D BIT(PMD_ORDER); PMD_ORDER for 64k base PS systems would result in a 512M value, which excee= ds the xarray limit [1]. Therefore, I think we need to avoid PMD-size orders b= y checking if PMD_ORDER > MAX_PAGECACHE_ORDER. [1] https://lore.kernel.org/all/20240627003953.1262512-1-gshan@redhat.com/ > + anon_orders_configured =3D true; > + } > =20 > /* > * For pagecache, default to enabling all orders. powerpc's PMD_ORDER > @@ -955,6 +959,55 @@ static int __init setup_transparent_hugepage(char *s= tr) > } > __setup("transparent_hugepage=3D", setup_transparent_hugepage); > =20 > +static int __init setup_thp_anon(char *str) > +{ > + unsigned long size; > + char *state; > + int order; > + int ret =3D 0; > + > + if (!str) > + goto out; > + > + size =3D (unsigned long)memparse(str, &state); > + order =3D ilog2(size >> PAGE_SHIFT); > + if (*state !=3D ':' || !is_power_of_2(size) || size <=3D PAGE_SIZE || > + !(BIT(order) & THP_ORDERS_ALL_ANON)) > + goto out; > + > + state++; > + > + if (!strcmp(state, "always")) { > + clear_bit(order, &huge_anon_orders_inherit); > + clear_bit(order, &huge_anon_orders_madvise); > + set_bit(order, &huge_anon_orders_always); > + ret =3D 1; > + } else if (!strcmp(state, "inherit")) { > + clear_bit(order, &huge_anon_orders_always); > + clear_bit(order, &huge_anon_orders_madvise); > + set_bit(order, &huge_anon_orders_inherit); > + ret =3D 1; > + } else if (!strcmp(state, "madvise")) { > + clear_bit(order, &huge_anon_orders_always); > + clear_bit(order, &huge_anon_orders_inherit); > + set_bit(order, &huge_anon_orders_madvise); > + ret =3D 1; > + } else if (!strcmp(state, "never")) { > + clear_bit(order, &huge_anon_orders_always); > + clear_bit(order, &huge_anon_orders_inherit); > + clear_bit(order, &huge_anon_orders_madvise); > + ret =3D 1; > + } > + > + if (ret) > + anon_orders_configured =3D true; > +out: > + if (!ret) > + pr_warn("thp_anon=3D%s: cannot parse, ignored\n", str); > + return ret; > +} > +__setup("thp_anon=3D", setup_thp_anon); > + > pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma) > { > if (likely(vma->vm_flags & VM_WRITE)) > --=20 > 2.43.0 > =