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 2BE87C4332F for ; Mon, 13 Nov 2023 15:04:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 963736B0199; Mon, 13 Nov 2023 10:04:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 913C86B019D; Mon, 13 Nov 2023 10:04:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7DBAC6B019E; Mon, 13 Nov 2023 10:04:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 69FF46B0199 for ; Mon, 13 Nov 2023 10:04:29 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 34867407F2 for ; Mon, 13 Nov 2023 15:04:29 +0000 (UTC) X-FDA: 81453252258.05.E245650 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP id E79651C001D for ; Mon, 13 Nov 2023 15:04:25 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=T4JygIqS; dmarc=none; spf=none (imf20.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=1699887866; 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=ZBQ5a0hJZ/GfX0iieQrBicPR1Pwnet9ZpiDu5Dc5S8o=; b=ia2viwEoiS8sItpX7QFjvkOCbznT2rSPk86JmM9EOD5t1eUcnwraBYYYMyd2MEst4uNcQO /D474ieeI4Jh5weYynWnAYuIwmaJctHvhPt5oX0lm2zYGw+dnrB/C+bIGoANdMfcYnnd7u jICohzRjxnQrZVeZzZYOaY92FoBHzAw= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=T4JygIqS; dmarc=none; spf=none (imf20.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=1699887866; a=rsa-sha256; cv=none; b=ZDT0UUcjlbT7WjKmMgNCFB8rTwC5bjX89jRxfVZ0FEN+im1pl1SBFtaZIXyyujvYAQFrV1 rj+PqQygmiOVkYyB//qikJG076x262MJL1G7GWMCoU7nAHtKqV9YMJLgnuhf7hvmrF1aSr 7K10w0lyPM605Yc6slMdPhZDgx4A0cQ= 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=ZBQ5a0hJZ/GfX0iieQrBicPR1Pwnet9ZpiDu5Dc5S8o=; b=T4JygIqSJTI4zR7pgmmCZFqPiE Cuix9/8FMuTEaTJ2GiTMl9zVm70vXXkZ30telLR0jR+fttKqiv5V2IP2m0FzipRM96jnQKHlprEFp Y+h+Vm4ZC7GbL8wCbkUDU3KWWJDC6ZH0dEuD8xWwQP2Tuxvkte3ZMeOX656eFiCraCyqwyGMCcXqf EH02CShkSiYi4LeGns/w5lXlFX6sJ3xDuO11lHlpIFNdBNMcR3vs1Sv77gtYx707ggQFx0YNwHod0 KHMYYStbY//caLhJTuoCHEiDIF4aN4bzXJt+eFXej+JH266hPBrLtvilWpxrxkRyBk0zhfrj3yOzS bnH1rYaQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1r2YTu-00EsZO-5e; Mon, 13 Nov 2023 15:04:06 +0000 Date: Mon, 13 Nov 2023 15:04:06 +0000 From: Matthew Wilcox To: Ryan Roberts Cc: John Hubbard , Andrew Morton , Yin Fengwei , David Hildenbrand , Yu Zhao , Catalin Marinas , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama , "Kirill A. Shutemov" , David Rientjes , Vlastimil Babka , Hugh Dickins , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v6 0/9] variable-order, large folios for anonymous memory Message-ID: References: <20230929114421.3761121-1-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Stat-Signature: bxu9wjnhrix1pprzcztbq5ej769og5w4 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: E79651C001D X-HE-Tag: 1699887865-631081 X-HE-Meta: U2FsdGVkX19J7u3jgjnzkNX5bdrr320rQWiLHVF6L4B1s4UATs03cSo5H7jBW7DlzNqvyz/GuLKl2BNmQncy+Fw0gWDqmjdtC42ixMehLrIAWZJQv6UXomOlfcUKunVD5zTmnX6edH1pO/Y/AMHmtaS+Tm3Mo78RjW/BZMByBzx/Tl13oi4SuMiXhpQq02kuqFEw8xKDDvemafYSfon9AiT4NXJ97jdlxrTEkF5gCanwdX38yqGgpgi0T0GwMmIklPB+5tosSLUBSN2/KNdcH1TkGbJN4lssbrnReycK069KxfyiMzODfa3g3v9S8Wdmfr1+bpfCPxVzHWkWdvw1m4f0lp6/OK7FGOszaPviZaSlkrZXAZp3m96A06GvBZBvXqAOBSDR6jXwZM8FVK092c0E3c3UGDf99BJP6+HIYbsMUg5tavHjGx/MPnuL0pMosWp+0aALQ2ETCWPRnJx08zb++Vr2GTanpeqVWLZCr6qA+qoEdqeO8mDvR1R+/T3ynbGppNgMOsxJaqDkr4w8M7S4Q5JcguIwLWeBRiOs+O4wMvDJokSrqRU2oowB2yG5pfkweBQAFasvljJQ0HjHgrZfbN4Oj6tZE9y82k/apI6tGmRAja4rK7Jk673cs+tOPFm9Ilq0k3TPVf65X8QdpB1V+TnnJE9FCGHeUSt5HBtacMzpQVeX//WduNvAi1R8yQ1nxmWahjwgDr9qPq4Qs0z5A/kId3DwjNcXe8hdVmwwjyFQGNRHLm7CyLKyzrbYcc9ig6XNk8ZySkrtWemTbUSCArAZxL8oT+4ogFBu9Cl8VNepAV1rMx2ExM9me7+1GkXfCP+DYJfgZW/tNuglsv/EBp9su15bhMyLLi+xE9jQ1igK+OItArqxvQCjCw/LJ8GOHOMj9HrmnJ7+SEl8uRoG5jH5vsmhe0fD9skKQmaxCpX7iLQyn8URZT6T5el0Ved+XHWpiecPBTlvg6+ R7ULd+xY ddU6eZ0330LYpxtMiHt1jsc1AUMaf80PebJd79iLZ0g6BK9CbX7+PXAlpcjNp0tCy2WFGXNOS3KPrY+m3LHw0SDPI1MGd5VJqaw01OTE9jDJedIrRWxg1Y1ELmnfbOia/fJjnsvBB+qNgnmor45CmGsjJWjSGU4dWEESavrNcnIR47cNwyyJQjwpqg7oASbCuPcuH3A/Rtb2E4iZ0Eq2RNiTzJQ== 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 Mon, Nov 13, 2023 at 10:19:48AM +0000, Ryan Roberts wrote: > On 13/11/2023 05:18, Matthew Wilcox wrote: > > My hope is to abolish the 64kB page size configuration. ie instead of > > using the mixture of page sizes that you currently are -- 64k and > > 1M (right? Order-0, and order-4) > > Not quite; the contpte-size for a 64K page size is 2M/order-5. (and yes, it is > 64K/order-4 for a 4K page size, and 2M/order-7 for a 16K page size. I agree that > intuitively you would expect the order to remain constant, but it doesn't). > > The "recommend" setting above will actually enable order-3 as well even though > there is no HW benefit to this. So the full set of available memory sizes here is: > > 64K/order-0, 512K/order-3, 2M/order-5, 512M/order-13 > > > , that 4k, 64k and 2MB (order-0, > > order-4 and order-9) will provide better performance. > > > > Have you run any experiements with a 4kB page size? > > Agree that would be interesting with 64K small-sized THP enabled. And I'd love > to get to a world were we universally deal in variable sized chunks of memory, > aligned on 4K boundaries. > > In my experience though, there are still some performance benefits to 64K base > page vs 4K+contpte; the page tables are more cache efficient for the former case > - 64K of memory is described by 8 bytes in the former vs 8x16=128 bytes in the > latter. In practice the HW will still only read 8 bytes in the latter but that's > taking up a full cache line vs the former where a single cache line stores 8x > 64K entries. This is going to depend on your workload though -- if you're using more 2MB than 64kB, you get to elide a layer of page table with 4k base, rather than taking up 4 cache lines with a 64k base.