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 83E6DD1AD24 for ; Wed, 16 Oct 2024 08:14:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0FA1F6B0083; Wed, 16 Oct 2024 04:14:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0AA156B0088; Wed, 16 Oct 2024 04:14:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F01BC6B0089; Wed, 16 Oct 2024 04:14:49 -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 CFBAD6B0083 for ; Wed, 16 Oct 2024 04:14:49 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 9B9B241B70 for ; Wed, 16 Oct 2024 08:14:43 +0000 (UTC) X-FDA: 82678754214.29.2FC225F Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf18.hostedemail.com (Postfix) with ESMTP id 459EB1C0009 for ; Wed, 16 Oct 2024 08:14:44 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.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=1729066414; a=rsa-sha256; cv=none; b=stuY4IQUoEEodezzYZMx+8LhG4SGxxC2wzNxPx+e4rM8khNdw8nP34f+oAs9QcY6bm0rGR CGPvGoJ2W8gn8zMc/CbQPKdO7mh90p0N4bqHJpZyhv1riLYtgCXFvkZ1SnKdYcjSt1n5zt rGtdZF4gCtP93xxL1xL7JspjjvDDXwg= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.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=1729066414; 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=R76wA9NuXs5S0KZjp0IwX/8ddmkpZn5t/ktBUkIwHn8=; b=UhuSJtdugXQ7TNO7P6nzgic2yZwDX1magoRu5XnuvQEGMXu7ZIgWmB4TU8pG7oieBTds6m BXfl1oYmLy680ODNhY6m06IkUutmEmE0Q33x/knd1GIO/ds5otwrfFKkxkaKOTBm28JAfk SQseaUnjB4Pe5vSQ4PJsuEIdgAr+dpE= 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 5D218FEC; Wed, 16 Oct 2024 01:15:16 -0700 (PDT) Received: from [10.57.86.207] (unknown [10.57.86.207]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 399FC3F71E; Wed, 16 Oct 2024 01:14:43 -0700 (PDT) Message-ID: Date: Wed, 16 Oct 2024 09:14:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v1 57/57] arm64: Enable boot-time page size selection Content-Language: en-GB To: Zi Yan Cc: Andrew Morton , Anshuman Khandual , Ard Biesheuvel , Catalin Marinas , David Hildenbrand , Greg Marsden , Ivan Ivanov , Kalesh Singh , Marc Zyngier , Mark Rutland , Matthias Brugger , Miroslav Benes , Oliver Upton , Will Deacon , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20241014105514.3206191-1-ryan.roberts@arm.com> <20241014105912.3207374-1-ryan.roberts@arm.com> <20241014105912.3207374-57-ryan.roberts@arm.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: xs4tinwu5c5kr8phfp4gjhb8ibwkk5k6 X-Rspamd-Queue-Id: 459EB1C0009 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1729066484-306155 X-HE-Meta: U2FsdGVkX19fxoRMDO+q2e6wc8dfuNZNg1BKCAyUkDZPjr8AZp+v4eqtEm+qNpJg4Qheee7kSTJvVZQ1t5KMzjCgI9dkDICJYUhhOUDEm2acZrNVYR/Ix/EU64HH8ybeFsIaWu8qt4oyLVOzgVvN+9OYEiXojIBbHZVKYDoiPJcTUdWiCW/XjGCfjDR5eOK5DviQPPvSWBNqmW6XQzPYxreC1r9ZRLH06EXhzJ8Mxqt3uaWMHVgN6slvehgt7E0+Em0ut1GPdFOJJu+UgVvF+xDvre5soD2EjnjRrAw45h6YWOiDVNi1xhXFWrSPCySyw77o1SA7ZgkanidNNJl/ixalRtFA3fKIqyInmWfvcUjSZYio+JyIQpT+vnZKVGpEhCSw0NNK51fuHUFbjPPWgOXVcbGs9jHdsJNIYSbbZYK3jfvotNXLVn8d/oDwXMV1cPxC8D4kdFzHVtwm5YI8wK1dC1pEPLM0poMJ00aEGQphydHPT9u3qv8g6kdia8+vmYoX436Wend2L9RAOxivoN+NOcZFzXNYxx4DMZt1EpsEjdQpn5kQSapGTXC6si0W7A+D3VsyByfQTOxnxk6mb0SmoAqnMElu1gX0nzwuTW9QaB5TzxVNilL/o8T52XFujYW4u+9njzPmwq4PtzknY5rT/iEHvBku8ARBJRaPEvHC9gCMiBv4ncswbAtH5X3X9bicZpgo+hfsxRk6ao+ntB3GD5lJlwf//+Ap7q06cqytABETmcIANYjS7cVJG36GC8xnIBp/zdmeSBNw4n8wZ1ROzZQLCecXEkOF2izlcR3fLdB9Cc1nNmrUiud3AdRoy1FxnGjgb/w24eTlxxpYbXKe4nJF4ivIRI6+fa7W5zwfoeE8DpMgXUToHY42deqnZRy8L30tKcAR1XwF7LETxxFva39/a3X/pjA4SUwIZYIIVzhwO9okpGNegCVWZMMC5MA3eg3zs2oyX7mMIG2 ISCDRrqX v0e18zBNwkAU6LV0UJuy6tikD/iloso6ofSzA/xTXLS348XcBc9xOMBRWRUSfIK0AyQP+dkLMo8D3D4jpXJUMtIp/LXOE7H3VTfgN6DSQ+mgTVwsx8Ariu/SfaVqduNO4TPggiYGeeklTXphN8YgkRBI86ZQOlGXm6xvTjRiYZTmHK0C4let00W0nnEjbANk3pXAdxl7CtvRZnjQ= 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 15/10/2024 18:42, Zi Yan wrote: > On 14 Oct 2024, at 6:59, Ryan Roberts wrote: > >> Introduce a new Kconfig, ARM64_BOOT_TIME_PAGE_SIZE, which can be >> selected instead of a page size. When selected, the resulting kernel's >> page size can be configured at boot via the command line. >> >> For now, boot-time page size kernels are limited to 48-bit VA, since >> more work is required to support LPA2. Additionally MMAP_RND_BITS and >> SECTION_SIZE_BITS are configured for the worst case (64K pages). Future >> work could be implemented to be able to configure these at boot time for >> optimial page size-specific values. >> >> Signed-off-by: Ryan Roberts >> --- > > > >> >> @@ -1588,9 +1601,10 @@ config XEN >> # 4K | 27 | 12 | 15 | 10 | >> # 16K | 27 | 14 | 13 | 11 | >> # 64K | 29 | 16 | 13 | 13 | >> +# BOOT| 29 | 16 (max) | 13 | 13 | >> config ARCH_FORCE_MAX_ORDER >> int >> - default "13" if ARM64_64K_PAGES >> + default "13" if ARM64_64K_PAGES || ARM64_BOOT_TIME_PAGE_SIZE >> default "11" if ARM64_16K_PAGES >> default "10" >> help > > So boot-time page size kernel always has the highest MAX_PAGE_ORDER, which > means the section size increases for 4KB and 16KB page sizes. Any downside > for this? I guess there is some cost to the buddy when MAX_PAGE_ORDER is larger than it needs to be - I expect you can explain those details much better than I can. I'm just setting it to the worst case for now as it was the easiest solution for the initial series. > > Is there any plan (not in this patchset) to support boot-time MAX_PAGE_ORDER > to keep section size the same? Yes absolutely. I should have documented MAX_PAGE_ORDER in the commit log along with the comments for MMAP_RND_BITS and SECTION_SIZE_BITS - that was an oversight and I'll fix it in the next version. I plan to look at making all 3 values boot-time configurable in future (although I have no idea at this point how involved that will be). Thanks, Ryan > > Best Regards, > Yan, Zi