All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/mm: increase pgt_buf size for 5-level page tables
Date: Wed, 16 Dec 2020 13:56:23 +0300	[thread overview]
Message-ID: <20201216105623.e65a43mhegoqgldt@box> (raw)
In-Reply-To: <20201215205641.34096-1-lstoakes@gmail.com>

On Tue, Dec 15, 2020 at 08:56:41PM +0000, Lorenzo Stoakes wrote:
> pgt_buf is used to allocate page tables on initial direct page mapping
> bootstrapping us into being able to allocate these before the direct
> mapping makes further pages available.
> 
> INIT_PGD_PAGE_COUNT is set to 6 pages (doubled for KASLR) - 3 (PUD, PMD,
> PTE) for the 1 MiB ISA mapping and 3 more for the first direct mapping
> assignment in each case providing 2 MiB of address space.
> 
> This has not been updated for 5-level page tables which additionally has a
> P4D page table level above PUD.
> 
> In most instances this will not have a material impact as the first 4 page
> levels allocated for the ISA mapping will provide sufficient address space
> to encompass all further address mappings. If the first direct mapping is
> within 512 GiB of the ISA mapping we need only add a PMD and PTE in the
> instance where we are using 4 KiB page tables (e.g. CONFIG_DEBUG_PAGEALLOC
> is enabled) and only a PMD if we can use 2 MiB pages (the first allocation
> is limited to PMD_SIZE so we can't use a GiB page there).
> 
> However if we have more than 512 GiB of RAM and are allocating 4 KiB page
> size we require 3 further page tables and if we have more than 256 TiB of
> RAM at 4 KiB or 2 MiB page size we require a further 3 or 4 page tables
> respectively.
> 
> This patch updates INIT_PGD_PAGE_COUNT to reflect this.
> 
> Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

-- 
 Kirill A. Shutemov

  reply	other threads:[~2020-12-16 10:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 20:56 [PATCH] x86/mm: increase pgt_buf size for 5-level page tables Lorenzo Stoakes
2020-12-16 10:56 ` Kirill A. Shutemov [this message]
2020-12-16 18:04 ` Dave Hansen
2021-01-04 14:52   ` Lorenzo Stoakes
2021-01-04 18:29 ` [tip: x86/mm] x86/mm: Increase " tip-bot2 for Lorenzo Stoakes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201216105623.e65a43mhegoqgldt@box \
    --to=kirill@shutemov.name \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lstoakes@gmail.com \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.