Skip to contentSkip to conversation

PTE --> 2 values??

DISCUSSION John Smith 2 participants 2 messages Nov 24, 2003

lore
Share & tools
lore

John Smith

author
#0 lore raw

I saw that Linux is using a 3 level page tables, pgd, pmd and pte. The value in the pte can refer to an actual page in memory OR an address on the swap device. How does the kernel distinguish the two values such that if the value is refering to an swap device address, it will not lookup the address in memory ??

John.

#1 lore raw
Quoted 5 lines · John Smith

I saw that Linux is using a 3 level page tables, pgd, pmd and pte. The value in the pte can refer to an actual page in memory OR an address on the swap device. How does the kernel distinguish the two values such that if the value is refering to an swap device address, it will not lookup the address in memory ??

There is a present bit. All other bits are available to the OS when the present bit says "not present". On many machines, Linux' 3-level tree is a pure software construct, and the processor is informed of translations in other ways (e.g. inverted pagetables, direct TLB insertion).

-- wli