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 C45BDEB64DA for ; Wed, 5 Jul 2023 12:09:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 29CE78D0002; Wed, 5 Jul 2023 08:09:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 24CC88D0001; Wed, 5 Jul 2023 08:09:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13DCC8D0002; Wed, 5 Jul 2023 08:09:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 058CC8D0001 for ; Wed, 5 Jul 2023 08:09:06 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B9FC1140B37 for ; Wed, 5 Jul 2023 12:09:05 +0000 (UTC) X-FDA: 80977437450.08.F903EAB Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id 0168680020 for ; Wed, 5 Jul 2023 12:09:02 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=p8H82thF; dmarc=none; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688558943; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Cy83JkJmnxLA9dztdWd+Q9yw3dWpEbujYErrO2HQQ3o=; b=PBzKIphPcH9FuEHbb+sRin0Kp6lPBpL5pTafgN6xkEU+Jm8nqWRzhv54p3T0nWW+vAVRoE mCCICg0PLf8AEiXUge+1sez6m/MDG3EHSU+G0B97itvnyqFu0YF7LhO4sSi+1qnualMeVU YRHarNjoBI3FsGHhxQgR8Ll0zxYIaPM= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=p8H82thF; dmarc=none; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688558943; a=rsa-sha256; cv=none; b=bUqzDSCBTqcHNiWc7YEC01GctK8lcIjygLi+HQ9n+n2WOa4VdASJ3w7prI+PlGeSd7XfoQ ClwshX0ssm2eWkDxehUzm+SpLko68bd5vuS1iLNW2NAIVe3PIaMsIBYwuOoI18SUPl8eeS 3a3JaLwrMeAexPr2fVO3w/NXKFunrKY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Cy83JkJmnxLA9dztdWd+Q9yw3dWpEbujYErrO2HQQ3o=; b=p8H82thFSahW225r9+3bsg9+R5 khUwiWnFyk2vYVOOTaW0KJfGwFKhQkIjgGcoYqH0MYWj3FUEFP6wWostiKFkLL3KEvGtB7JYad/av h94oZ+uHVAVAGo49iRthhgQbKA6PR8dcvOoc5d2oUr2TOcnyAq1LO6kdWU+n5MvZ5dXy0PUTY8mc3 3gDzy7inaTP8oV3LAgZBl0VKKV2EcIQPCdlwF7lyQ/vU82wWLtiGAq8Fe7r6nOjczFL8AgG9C+ymJ GphtZwLoao0kPsDakcWlY9+L9UQCnBYIpHAvdfRpBHPaQx+C72MDReHs8ulba5SmrG5OdgyKeszNW leg0mZ5g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qH1JQ-00A3K5-Hy; Wed, 05 Jul 2023 12:08:48 +0000 Date: Wed, 5 Jul 2023 13:08:48 +0100 From: Matthew Wilcox To: Ryan Roberts Cc: "Yin, Fengwei" , Andrew Morton , "Kirill A. Shutemov" , David Hildenbrand , Yu Zhao , Catalin Marinas , Will Deacon , Anshuman Khandual , Yang Shi , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 4/5] mm: FLEXIBLE_THP for improved performance Message-ID: References: <20230703135330.1865927-1-ryan.roberts@arm.com> <20230703135330.1865927-5-ryan.roberts@arm.com> <6865a59e-9e40-282d-c434-b7c757388b65@intel.com> <4ee6e325-30ea-f74c-7d73-10a5d1453d01@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ee6e325-30ea-f74c-7d73-10a5d1453d01@arm.com> X-Rspamd-Queue-Id: 0168680020 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: ms381w8yeu116xbxnmpcesh15z3q6x6e X-HE-Tag: 1688558942-638389 X-HE-Meta: U2FsdGVkX1+cLS93QwHrpiHf5qhWR8l6KMF69NMS4b9ZJS9fdIEe9X7YG2c2hrcOadyzxZ1S6fu6VcPKZUTYwIq5CoKyj1jY3/x5uqdVenAsPIW3iwc78CEQTDXRxbIuWiJ0gPf4336TRIk2aAoVaYdHuK2WjC1XGfL4uUYQnKsiBmwk0hLgzDOI1pa7pgAqmsEUFCImfDbxN+k1HLS/9jss7WY03Rpdd+7iBbc3CdgXBBJ6HXEOffycS9db/2ezx5D0U+5ouG9ovVKX/e8Ip915bZcZld5J9Iaa6z0HxqyaIVTz2h2LHuO7DqBHwp7BpUSehpyovYv4YZ7/4E8q4Pt239+EepokRK5KMt3/TJ2WypdOBxlRiw2u7/4LqNlEi1qsZEdLE3vMbNwLahOrlX0mJaGtYFG6qHmxqgorwGRkGHnMiN38cI6DDBjYPFdRDGanZAD5It/9UVf/w+RphNsIeaoqm8+ZRQCQ3hoGKz4QCSfGhs4nA3xRlUEdAloS6KyFPTYNwNlzOJIB8CJqIv9UNCfOJCwavc6QFKHXg2QuMsxMC3WDPv6bJqAkfwXyDrF/nzcvVsO/Q7C3Za71T7jhJtrVSBN83IK9e7FVI3q2ssG3tbj5yq79mzLAlZpoHrOg72F8WukfKdS7vjr+qDOGcKeynNdf9AnIxUCCwCfwcKliAPNLYNMxS4wkEr86Tw1Blpm2n0GlyQasPEX/Et1IhCJBoL48Fn9+ifGJfzXqFnJdLN+HHUmfapQ/h1Ap65y2vPYhnpakrJR3wVUaWsAvSafKBBaQ3u4CyxYWpHxDbbqQfx/XakXSEMVCxwNIZ7FiWki8etjlZ+uujPNbqWir9i2r+UwN0mM+oI7KYeOWXq4wRpn+2Wq/fLu09S/DXVUWwShs7E+JtAtxLjANfui/m+V0n2mKqy2sW08bfvFOw8hydFvsPrr5G+7U8oPLKTzk61lhkESUYVcBJPo LJf6UMdh yACymSVz8qCLCcbgUgbn1U4rJCauZe16JtwbEL1JEYv/ZH/PByQ1YyIeQIkUxuSLC3K7TSfwH4JIW+2toI/nmgFCD2OXRqtwTnEmo+fR5GR5gTq/JgG5WUrmCqAMm2w/XqnUEKtw2+zpjBXLHXyluDtHRt5/GE8xi+u4i3/OHoLWuMQ94M2aShiHytase+ul4Gcw1 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: On Wed, Jul 05, 2023 at 10:54:30AM +0100, Ryan Roberts wrote: > On 05/07/2023 00:57, Matthew Wilcox wrote: > > The confusing thing is that we have counters for the number of THP > > allocated (and number of THP mapped), and for those we always use > > PMD-size folios. > > OK fair point. I really don't have a strong opinion on the name - I changed it > from LARGE_ANON_FOLIO because Yu was suggesting it should be tied to THP. So I'm > happy to change it back to LARGE_ANON_FOLIO (or something else) if that's the > concensus. But I expect I'll end up in a game of ping-pong. So I'm going to keep > this name for now and focus on converging the actual implementation to something > that is agreeable. Once we are there, we can argue about the name. I didn't see Yu arguing for changing the name of the config options, just having far fewer of them. > > If we must have a config option, then this is ANON_LARGE_FOLIOS. > > > > But why do we need a config option? We don't have one for the > > page cache, and we're better off for it. Yes, it depends on > > CONFIG_TRANSPARENT_HUGEPAGE today, but that's more of an accidental > > heritage, and it'd be great to do away with that dependency eventually. > > > > Hardware support isn't needed. Large folios benefit us from a software > > point of view. if we need a chicken bit, we can edit the source code > > to not create anon folios larger than order 0. > > >From my PoV it's about managing risk; there are currently parts of the mm that > will interact poorly with large pte-mapped folios (madvise, compaction, ...). We > want to incrementally fix that stuff, but until it's all fixed, we can't deploy > this as always-on. Further down the line when things are more complete and there > is more test coverage, we could remove the Kconfig or default it to enabled. We have to fix those places with the bad interactions, not merge a Kconfig option that lets you turn it on to experiment. That's how you get a bad reputation and advice to disable a config option. We had that for years with CONFIG_TRANSPARENT_HUGEPAGE; people tried it out early on, found the performance problems, and all these years later we still have articles being published that say to turn it off. By all means, we can have a golden patchset that we all agree is the one to use for finding problems, and we can merge the pre-enabling work "We don't have large anonymous folios yet, but when we do, this will need to iterate over each page in the folio".