Re: Why preallocate pmd in x86 32-bit PAE?

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: William Lee Irwin III <wli@...>, Andi Kleen <ak@...>, Ingo Molnar <mingo@...>, Thomas Gleixner <tglx@...>, Nick Piggin <nickpiggin@...>, H. Peter Anvin <hpa@...>, Linux Kernel Mailing List <linux-kernel@...>, Zachary Amsden <zach@...>
Date: Friday, November 16, 2007 - 2:30 pm

Linus Torvalds wrote:

3.8.5 in vol 3a "Page-Directory and Page-Table Entries With Extended
Addressing Enabled":

    The present flag (bit 0) in the page-directory-pointer-table entries
    can be set to 0 or 1. If the present flag is clear, the remaining
    bits in the page-directory-pointer-table entry are available to the
    operating system. If the present flag is set, the fields of the
    page-directory-pointer-table entry are defined in Figures 3-20 for
    4-KByte pages and Figures 3-21 for 2-MByte pages.

So I would assume this works on all current CPUs, but I can imagine that
some older/off-brand processors might get it wrong.


Yeah, I'm not so concerned about memory saving; I don't think there
would be any in practice.


I'm hoping to avoid special-casing anything, if I can help it, aside
from the normal 32/64-bit 2/3/4-level parameterising of the various
pagetable accessors.


Perhaps.  And there's the corresponding difference between 32 and 64 bit
on freeing a pagetable; 32-bit assumes the pgd destructor will free the
pmd, whereas 64-bit does it separately.  Even in the current 32-bit
code, there's separate handling for PAE and non-PAE.  I think it can all
be collapsed down in a reasonable way.


Yes, that is a bit awkward; it means that 32-bit PAE would need a
speparate pgd_populate.  But that seems like a smaller change than 1)
making 32-bit PAE pgd-alloc preallocate the pmd, and 2) making pmd_free
noop on 32-bit PAE, and 3) making pgd_free free the preallocated pmd. 
Perhaps 2 & 3 aren't necessary and can be the same as 64-bit.

I'll need to look into it more carefully.


Yep, absolutely.

    J
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Why preallocate pmd in x86 32-bit PAE?, Jeremy Fitzhardinge, (Thu Nov 15, 5:57 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, Linus Torvalds, (Thu Nov 15, 6:12 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, Jeremy Fitzhardinge, (Fri Nov 16, 1:12 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, H. Peter Anvin, (Fri Nov 16, 1:45 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, Linus Torvalds, (Fri Nov 16, 1:35 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, Jeremy Fitzhardinge, (Fri Nov 16, 3:14 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, Linus Torvalds, (Fri Nov 16, 3:22 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, Jeremy Fitzhardinge, (Fri Nov 16, 3:43 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, Jeremy Fitzhardinge, (Fri Nov 16, 2:30 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, H. Peter Anvin, (Thu Nov 15, 6:42 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, William Lee Irwin III, (Thu Nov 15, 8:40 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, H. Peter Anvin, (Thu Nov 15, 8:41 pm)
Re: Why preallocate pmd in x86 32-bit PAE?, Andi Kleen, (Fri Nov 16, 7:16 am)
Re: Why preallocate pmd in x86 32-bit PAE?, H. Peter Anvin, (Fri Nov 16, 11:45 am)
Re: Why preallocate pmd in x86 32-bit PAE?, Andi Kleen, (Fri Nov 16, 11:53 am)
Re: Why preallocate pmd in x86 32-bit PAE?, H. Peter Anvin, (Fri Nov 16, 12:10 pm)