From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4CEF1D1F67 for ; Wed, 16 Oct 2024 08:14:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066490; cv=none; b=BzMJZEri99Sv4Bk5fPEPiIR0cqAje6VSgY4vMo1Sggtmu5TjXjcrZoTuhoa2K6lmb/sUn20uAhVHaDP8n/GS+jQFXJg9ofjPrtWwbdIbG1aROwsIUn7tS/oyCofDkGDKByBRJ4STHQUKMUocXifIB/jpze1M7n6RUwF8K3JdRWw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066490; c=relaxed/simple; bh=wxQg2GJ5ktlDu9srXxIIKK0Wg/EJpooJh/rWWUWYADg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CqHFC+jaso7g+/wvVBCycH4OQ979BOAr+Dm/d/WKixA+iobpII6rBb76n86Rp2DVW4CQl9DHFA28EZn8lk4UabIM3DnqgUIgP9g0OzKttnbiDOTPG5Zy69qREXlT1UYbMac5Ppwa8oxvE6jTE8namYIpBmGJBCWKxQg37sGcFzs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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