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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 251B8D1AD2A for ; Wed, 16 Oct 2024 08:34:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=R76wA9NuXs5S0KZjp0IwX/8ddmkpZn5t/ktBUkIwHn8=; b=LseoLQuyt4nR73s6xiy+SeV0R3 V6E0cyBDGtHEw/QB1/TcbCgIlgZtsCwZ6Pl+KCxTyH/zNmR95qB5wbPkoXq77gJsK7O2k45/5RD0z 7ZDMTOoRr2E2HVt4G5srk3ekHHbv6Xz/yDMj47M8iPWLpUYq0GdWFwL1uE2ZTTPaBzaS87a3PdQt9 /8AysUxTODtMlAq5S3A2zsa6pohcNhZtqR2p8HFlyNVzdL1nJ3teqJ4TXgYmKpsTy6ZGz74ry7U2J JAFKDE9cV3OfSayxZn91omqHS+YY/mo/py1/RmDgecg3G/WVLLRBRaS8BhJVDKCm5QSIaZbracyVc WDTIcsbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0zTe-0000000B2pc-0zlF; Wed, 16 Oct 2024 08:33:54 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0zB9-0000000AyPO-3rYt for linux-arm-kernel@lists.infradead.org; Wed, 16 Oct 2024 08:14:50 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241016_011448_130334_646CEE1B X-CRM114-Status: GOOD ( 21.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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