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 4D382C4332F for ; Tue, 31 Oct 2023 11:50:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D9EBA6B02E8; Tue, 31 Oct 2023 07:50:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D4F7A6B02E9; Tue, 31 Oct 2023 07:50:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C17FF6B02EA; Tue, 31 Oct 2023 07:50:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B217E6B02E8 for ; Tue, 31 Oct 2023 07:50:41 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8896BC0BD8 for ; Tue, 31 Oct 2023 11:50:41 +0000 (UTC) X-FDA: 81405589482.11.E1FA1CE Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf13.hostedemail.com (Postfix) with ESMTP id B120920024 for ; Tue, 31 Oct 2023 11:50:39 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf13.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698753040; 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; bh=fm+WVAXwKpoUceWtZK/836U9zkVxmnbA+hHP1FTqvFQ=; b=UmX7EF17cIuQTwGKn1HPH3wT2hJPkd9EMcXgFGrR2ChmWzraCy3dvavL2mWClJ+jdHAoY2 Sqp1Hhws43iidCzNa4BYUrMSKDUAOxSzuBmd6l3bqsTtzdxX7RFNqEwlqxXgyMo7oxs1ny fb2KR03HF/TNeBz1eu6BApMSW0BhyCU= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf13.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698753040; a=rsa-sha256; cv=none; b=afCbFv7GCShbnD/dChsBM/R5g+FDUcJfWepy9hEGMfBPT+0PGxjsINZrm89ADyqeWzubwq nx85zMcIovJpKrcZdiAuTp2mtyaiKAafnQefy0PKBSlcToGDVdcFlielb9g7MbrIvMXWML D76GJ+OuKCu5Ltrcol/DomqLxhlsbVM= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 56E36C15; Tue, 31 Oct 2023 04:51:20 -0700 (PDT) Received: from [10.1.34.180] (XHFQ2J9959.cambridge.arm.com [10.1.34.180]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CE4B3F64C; Tue, 31 Oct 2023 04:50:35 -0700 (PDT) Message-ID: <7a3a2d49-528d-4297-ae19-56aa9e6c59c6@arm.com> Date: Tue, 31 Oct 2023 11:50:34 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 0/9] variable-order, large folios for anonymous memory Content-Language: en-GB To: David Hildenbrand , Andrew Morton , Matthew Wilcox , Yin Fengwei , Yu Zhao , Catalin Marinas , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama , "Kirill A. Shutemov" , John Hubbard , David Rientjes , Vlastimil Babka , Hugh Dickins Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20230929114421.3761121-1-ryan.roberts@arm.com> <6d89fdc9-ef55-d44e-bf12-fafff318aef8@redhat.com> From: Ryan Roberts In-Reply-To: <6d89fdc9-ef55-d44e-bf12-fafff318aef8@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: B120920024 X-Stat-Signature: 94khkcxnq4r4uambrpexc9tmr7at6i5u X-Rspam-User: X-HE-Tag: 1698753039-431580 X-HE-Meta: U2FsdGVkX1+FGwgw8bZmd+0VlKvFYq/lG9OzfBh086ax2bIMHxbAIwF9OF/zV4JzgZiL1JyX90QVTaBBgZs0/H7BuNcwNGL4Gy1dOA7fbXtZIkSY1k0jxZqrXWk+sKCpfKF7iNIrJLyWD5Nai0YHZfOMrEBYH+3mD53Ft9EQZOkNjSj0DoUmyDiPiIsQZtEzqCeO6gnKi5sevaPqcdgqGpszSa2HjDg0dcxESOBmVA8rF7HPU79j/qNDL1lWc/izkq+hlRv8KaQBe1yB8702s4UR8Ogc0uMB+jvjI4a0Rawn+NHA82vj78t42lcBux9Zm++9OBWC8hz6v2J81uFDi80mljdHJIdJFLCz8rdphnXpyhNhcKynPdjELX2BYvwncRwsObqYc/GAbu2CZmmLRI4j+nrHzHukOBJlhr0PQF1FX9JsDvriHxPVhuhcA/4cYbrPhVqrgGJofI4xZMDUp1QY6hOL4jHxBYM1hBaiddUbp7SLR4EAffB1xo4BnPhAYVmlk1DF5+HUzgT7i04Xvc7vF10/okvQFqIdY+o0GtA3RRwOMAJJaA5mnYmd1/PgR90gVDdsByy/biPL28jDB5ETcy+mjHUvc/GnYMRo94CqA+ybJIjCfWXqOFp/ZTLKT9YoaScttAjWo47sGbSfN0B44ON+7aHaQEmerHYBClZqD+2eZxLLazJLvzj3JOBnpMTAd9fsemxBv7hZbSpAf9HSsygXy9QqcE7JctaNkDjLgbaVaxINJ+LDFgo6Uqftq3KO3dum3ghpR+0/Gac49f0lKJA+sH8kLZ2NXtYPRHUP9qtc2Bx2urk31GJGhMtDfbJIf5tFA3IFpLMvsdbap9+hAP6jKOstfEPZByE3KKXPJLRFquvlwLjkZ2Qx1529tS6pGLBatBIc7xp+u6aBbDu0RelAKQPWT3F7NOvsH2TF5Z8gXfu2NEbsItJFSnNTRhS63tCL46lpFMQml2k wvFZqcJ1 4baV3orPavXk7Ni/xamTgRgC6CHEABs3FfexvGbk8VlEF2/3zBA13n4VvKX7KDFq0G68cmniRvwgEC5TYshdcu333YVr7+zLu9CAjwBJnHIC76haqXwjdP6Tyd1a3/jheLKC/A8vu0aeO/Vprrp9mGxJq/u5QraB476ALfbq+FDBIr3If1YXB8ya/yx0kcNOVHkLBITDu7uiq9W3TH9r85umi87rDLZLHGXw5 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 06/10/2023 21:06, David Hildenbrand wrote: [...] > > Change 2: sysfs interface. > > If we call it THP, it shall go under "/sys/kernel/mm/transparent_hugepage/", I > agree. > > What we expose there and how, is TBD. Again, not a friend of "orders" and > bitmaps at all. We can do better if we want to go down that path. > > Maybe we should take a look at hugetlb, and how they added support for multiple > sizes. What *might* make sense could be (depending on which values we actually > support!) > > > /sys/kernel/mm/transparent_hugepage/hugepages-64kB/ > /sys/kernel/mm/transparent_hugepage/hugepages-128kB/ > /sys/kernel/mm/transparent_hugepage/hugepages-256kB/ > /sys/kernel/mm/transparent_hugepage/hugepages-512kB/ > /sys/kernel/mm/transparent_hugepage/hugepages-1024kB/ > /sys/kernel/mm/transparent_hugepage/hugepages-2048kB/ > > Each one would contain an "enabled" and "defrag" file. We want something minimal > first? Start with the "enabled" option. > > > enabled: always [global] madvise never > > Initially, we would set it for PMD-sized THP to "global" and for everything else > to "never". Hi David, I've just started coding this, and it occurs to me that I might need a small clarification here; the existing global "enabled" control is used to drive decisions for both anonymous memory and (non-shmem) file-backed memory. But the proposed new per-size "enabled" is implicitly only controlling anon memory (for now). 1) Is this potentially confusing for the user? Should we rename the per-size controls to "anon_enabled"? Or is it preferable to jsut keep it vague for now so we can reuse the same control for file-backed memory in future? 2) The global control will continue to drive the file-backed memory decision (for now), even when hugepages-2048kB/enabled != "global"; agreed? Thanks, Ryan