Skip to contentSkip to conversation

REAL_PTRS_PER_PMD and TIF_32BIT

DISCUSSION Ed L Cashin 2 participants 4 messages Mar 16, 2004

lore
Share & tools
lore
#0 lore raw

Hi. As far as I can tell, PTRS_PER_PMD will evaluate to 512 when a 32-bit binary in userland makes a system call or has a page fault, since TIF_32BIT will be set in the thread flags.

I suppose that means that for every second-level page table associated with a 32-bit binary's process, there are (2048 - 512) unused pmd entries. Is that correct?

Signature · 2 lines
--Ed L Cashin            |   PGP public key:
  [email protected]        |   http://noserose.net/e/pgp/
#1 lore raw
Quoted 7 lines · On Tue, 16 Mar 2004 15:51:47 -0500 Ed L Cashin <[email protected]> wrote:

Hi. As far as I can tell, PTRS_PER_PMD will evaluate to 512 when a 32-bit binary in userland makes a system call or has a page fault, since TIF_32BIT will be set in the thread flags.

I suppose that means that for every second-level page table associated with a 32-bit binary's process, there are (2048 - 512) unused pmd entries. Is that correct?

Yes, on sparc64, this is what effectively happens. We only need one PMD to map the page tables for a 32-bit process on sparc64.

#2 lore raw
In reply to Ed L Cashin
Quoted 7 lines · David S. Miller
Quoted 4 lines · On Tue, 16 Mar 2004 15:51:47 -0500 Ed L Cashin <[email protected]> wrote:

Hi. As far as I can tell, PTRS_PER_PMD will evaluate to 512 when a 32-bit binary in userland makes a system call or has a page fault, since TIF_32BIT will be set in the thread flags.

Quoted 6 lines
Quoted 3 lines

I suppose that means that for every second-level page table associated with a 32-bit binary's process, there are (2048 - 512) unused pmd entries. Is that correct?

Yes, on sparc64, this is what effectively happens. We only need one PMD to map the page tables for a 32-bit process on sparc64.

I notice that in the kernel "pmd" is used to mean both the second level page table, consisting of 2048 four-byte entries, and also as shorthand for one of those entries. Did you intentionally use all-caps for "PMD" to distinguish it from a second-level page table entry?

Signature · 2 lines
--Ed L Cashin            |   PGP public key:
  [email protected]        |   http://noserose.net/e/pgp/
#3 lore raw
In reply to Ed L Cashin
Quoted 5 lines · On Tue, 16 Mar 2004 16:03:23 -0500 Ed L Cashin <[email protected]> wrote:

I notice that in the kernel "pmd" is used to mean both the second level page table, consisting of 2048 four-byte entries, and also as shorthand for one of those entries. Did you intentionally use all-caps for "PMD" to distinguish it from a second-level page table entry?

It's just sylistic for C code that CPP macros are capitalized, that's all.