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 69D9AC02181 for ; Mon, 20 Jan 2025 13:38:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D39306B0082; Mon, 20 Jan 2025 08:38:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CE90B6B0083; Mon, 20 Jan 2025 08:38:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD8A16B0085; Mon, 20 Jan 2025 08:38:06 -0500 (EST) 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 983E06B0082 for ; Mon, 20 Jan 2025 08:38:06 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4C5B21C4D8C for ; Mon, 20 Jan 2025 13:38:06 +0000 (UTC) X-FDA: 83027933772.05.62A10DF Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf22.hostedemail.com (Postfix) with ESMTP id 818DAC000F for ; Mon, 20 Jan 2025 13:38:04 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737380284; 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=AtRk8QruzwN7ZVogiDjJVRcTE0GQGozUBD+e5fR6wb8=; b=gyNCK+ggzoOurL6wVzDdLWR6YEJxqbiwr8Uf0MPsCcJ/NxuSC6Q4vjgtIY9teuqtnCOKMW LdV82+ZMtXJFh2cbX6RD40/tb3R5O8O+rc3M5MBLicsDtkYxX4ixioWpwQf0M80GR9pZGe AdayG1YF8uvHRDxyJpw3wJFjg73nkNc= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737380284; a=rsa-sha256; cv=none; b=RlzRZ2ArEI/0MuY1bzVyQIBA4tjuzaoyiaP/gTQFkky+eIyJvr+BjjCMgTHlyHhUa6NEHs XwWVqE/RyIFOwbZGA6dyACl06/QVgY0j4DhCxf5XsLExnZJuiqbq1KQcV7eiJIyQTIqZKq zGsRYBJ8g4+ThQmAIW4e+Q4aY6GAG1E= 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 1D02E1063; Mon, 20 Jan 2025 05:38:32 -0800 (PST) Received: from [10.57.80.131] (unknown [10.57.80.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8A2DB3F740; Mon, 20 Jan 2025 05:37:58 -0800 (PST) Message-ID: <0a318ea8-7836-405a-a033-f073efdc958f@arm.com> Date: Mon, 20 Jan 2025 13:37:57 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 00/11] khugepaged: mTHP support Content-Language: en-GB To: David Hildenbrand , Nico Pache Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, anshuman.khandual@arm.com, catalin.marinas@arm.com, cl@gentwo.org, vbabka@suse.cz, mhocko@suse.com, apopple@nvidia.com, dave.hansen@linux.intel.com, will@kernel.org, baohua@kernel.org, jack@suse.cz, srivatsa@csail.mit.edu, haowenchao22@gmail.com, hughd@google.com, aneesh.kumar@kernel.org, yang@os.amperecomputing.com, peterx@redhat.com, ioworker0@gmail.com, wangkefeng.wang@huawei.com, ziy@nvidia.com, jglisse@google.com, surenb@google.com, vishal.moola@gmail.com, zokeefe@google.com, zhengqi.arch@bytedance.com, jhubbard@nvidia.com, 21cnbao@gmail.com, willy@infradead.org, kirill.shutemov@linux.intel.com, aarcange@redhat.com, raquini@redhat.com, dev.jain@arm.com, sunnanyong@huawei.com, usamaarif642@gmail.com, audra@redhat.com, akpm@linux-foundation.org References: <20250108233128.14484-1-npache@redhat.com> <40a65c5e-af98-45f9-a254-7e054b44dc95@arm.com> <37375ace-5601-4d6c-9dac-d1c8268698e9@redhat.com> From: Ryan Roberts In-Reply-To: <37375ace-5601-4d6c-9dac-d1c8268698e9@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 818DAC000F X-Stat-Signature: 9j39qfmq6mwurem8jadnej6546uoap3b X-HE-Tag: 1737380284-171598 X-HE-Meta: U2FsdGVkX18f6fZ6oKGB5wv1lXDg13HwIb1pfIs6wDS1ZHi/jUvyBPhsw1byVksp2kRd+kGy98cEdgvs6ZNuS1MzRhJdlrzrn11HspR7tA7SKm2c3btjk40wIWKkk2n77x48PvGqiU614+FRS5aKxnjgAcpf727l71iSTGfMhfThAa9VlxFJUfc77HybQE9WbzhdzsG2OZotE1FgdGl1zo3Hf6yRzYiTh7WVlBzkCwdT1yLpXZhKTtgF/iCpvLjsfyXg1ZHgymSAAm1JrqOqzlwZFV3G9k5pmFKOuEJKxgdwe2KfsxL1Cp6nJY3CeNEwYj/Tc40PjtcunZb2xO+azVUCFe6NarCRx61eZZVkZWMmttwPbBla3FztSWx1TYk47PvcXLLnmLNp3jpte0sVnteai6ws6HlPT/w8bGHlnKM48zI1kMKf1GIUOFnaW95YkvaqwLmXmBiVgRrDB3+7jgFMWiZQ9fyMQ3lms8qd4R7VCkI82Vj2hXpufi/zzRUVg8trunlC02MDoZVQPZCyVCUBR70YOdpPNQrPulRRggbYVWKLdcemcz9uCtG4Y5/zqBWckoTSA1MI/prnzbzvxIGh1GUcxpAyn0eZhaJRses7Oa/Oc3bdUK6TlCEOh6fark+0dUM7+QKoK1yW7NwFiFfvl8GrgLo1XqJNbzWDcb998sA5oP+lNNhZcuZjW49sv31uDcnWE/4W6xEpKTLUYc/Kjyd1mXdLJM1hXWYrwnx+MT7G2MQZpSczKWbZ8Z8AHgCOogzLCCuGrY9bb/0HubHAH1i77SC7FvfHGMCrD1zaszZGypUkdtzqJnjNzXgyU5nYjWFctqyxOb6n2Oqm/Xmg7luOl9yyDaIGs+u55DAqRlVQKDZq54VlWL+7KuI5vKjQjm8wNpaJcACbWpgQcEg1cR9jgiPPXPAcbqvWDS/6emogrmSWF/ZNHd+L+ciiaPQYiQ1Ks/nfhm+IMjx 9nVzJ3jA ZT9DQNo3qjfYfHeX7uUDwf4bGvvryBtlSfgwhGBgOrBkmvQp01jVa5nXRjeS5POhSp4y8zaKISArePkZ3YD423HgerIaLOT+f2ZOlyEmQKe5kAdhYVadCn9NabLd2PM3faXrgONOUQ+g5QlT2f3O4HidDiQEahyI5JijuHNp96xxd0d50G1ql9Y+IAR3zUgG8or4gYPtqFHssCRx9OHdl+/tjgg== 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 20/01/2025 12:54, David Hildenbrand wrote: >>> I think the 1 problem that emerged during review of Dev's series, which we don't >>> have a proper solution to yet, is the issue of "creep", where regions can be >>> collapsed to progressively higher orders through iterative scans. At each >>> collapse, the required thresholds (e.g. max_ptes_none) are met, and the collapse >>> effectively adds more non-none ptes so the next scan will then collapse to even >>> higher order. Does your solution suffer from this (theoretical/edge case) issue? >>> If not, how did you solve? >> >> Yes sadly it suffers from the same issue. bringing max_ptes_none much >> lower as a default would "help". > > Can we just keep it simple and only support max_ptes_none = 511 ("pagefault > behavior" -- PMD_NR_PAGES - 1) or max_ptes_none = 0 ("deferred behavior") and > document that the other weird configurations will make mTHP skip, because "weird > and unexpetced" ? :) > That sounds like a great simplification in principle! We would need to consider the swap and shared tunables too though. Perhaps we can pull a similar trick with those?