public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: William Lee Irwin III <wli@holomorphy.com>,
	Andi Kleen <ak@suse.de>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Why preallocate pmd in x86 32-bit PAE?
Date: Fri, 16 Nov 2007 09:12:19 -0800	[thread overview]
Message-ID: <473DCF73.4070401@goop.org> (raw)
In-Reply-To: <alpine.LFD.0.9999.0711151403000.4260@woody.linux-foundation.org>

Linus Torvalds wrote:
> On Thu, 15 Nov 2007, Jeremy Fitzhardinge wrote:
>   
>> Once difference is that 64-bit incrementally allocates all levels of the
>> pagetable, whereas 32-bit PAE preallocates the 4 pmds when it allocates
>> the pgd.  What's the rationale for this?  What pitfalls would there be
>> in making them incrementally allocated?
>>     
>
> IIRC, the present bit is ignored in the magic 4-entry PGD.  All entries 
> have to be present.
>   

Hm, do you recall what processors that might affect?  As far as I know,
current processors will ignore non-present top-level entries.  Anyway,
we can point them not present to empty_zero_page, so testing the present
bit will still be sufficient to tell if we need to allocate a new pmd,
but if the hardware decides to follow the page reference there's no harm
done.  (Hm, unless the hardware decides it wants to set A or D bits in
empty_zero_page for some reason...)

> What earlier CPU's did was to basically load all four values into the CPU 
> when you loaded %cr3. There was no "three-level page table walker" at all: 
> it was still a two-level page table walker, there were just for magic 
> internal page tables that were indexed off the two high bits.
>   

That just means we need to reload cr3 after populating the pgd with a
new pmd, right?

    J

  parent reply	other threads:[~2007-11-16 17:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-15 21:57 Why preallocate pmd in x86 32-bit PAE? Jeremy Fitzhardinge
2007-11-15 22:12 ` Linus Torvalds
2007-11-15 22:42   ` H. Peter Anvin
2007-11-16  0:40     ` William Lee Irwin III
2007-11-16  0:41       ` H. Peter Anvin
2007-11-16 11:16         ` Andi Kleen
2007-11-16 15:45           ` H. Peter Anvin
2007-11-16 15:53             ` Andi Kleen
2007-11-16 16:10               ` H. Peter Anvin
2007-11-16 17:12   ` Jeremy Fitzhardinge [this message]
2007-11-16 17:35     ` Linus Torvalds
2007-11-16 18:30       ` Jeremy Fitzhardinge
2007-11-16 19:14       ` Jeremy Fitzhardinge
2007-11-16 19:22         ` Linus Torvalds
2007-11-16 19:43           ` Jeremy Fitzhardinge
2007-11-16 17:45     ` H. Peter Anvin

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=473DCF73.4070401@goop.org \
    --to=jeremy@goop.org \
    --cc=ak@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=wli@holomorphy.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox