Skip to contentSkip to conversation

pte_addr_t size reduction for 64 GB case?

DISCUSSION Albert Cahalan 4 participants 4 messages May 19, 2004

lore
Share & tools
lore
#0 lore raw

When handling 64 GB on i386, pte_addr_t really only needs 33 bits to find the PTE. It sure doesn't need the full 64 bits it is using.

How about cheating a bit? If the pte_addr_t only had the high 32 bits of the 36-bit pointer, it would point to a pair of the 8-byte PTEs in a 16-byte chunk of RAM. Then simply examine the PTEs to see which one is the correct one.

#1 lore raw
Quoted 4 lines · Albert Cahalan

When handling 64 GB on i386, pte_addr_t really only needs 33 bits to find the PTE. It sure doesn't need the full 64 bits it is using.

yup.

Quoted 5 lines

How about cheating a bit? If the pte_addr_t only had the high 32 bits of the 36-bit pointer, it would point to a pair of the 8-byte PTEs in a 16-byte chunk of RAM. Then simply examine the PTEs to see which one is the correct one.

They might both map the same page. It could overflow into page->flags.

#2 lore raw
Quoted 3 lines · Albert Cahalan
Quoted 3 lines

When handling 64 GB on i386, pte_addr_t really only needs 33 bits to find the PTE. It sure doesn't need the full 64 bits it is using.

Quoted 1 line · Andrew Morton

yup.

Quoted 5 lines · Albert Cahalan
Quoted 5 lines

How about cheating a bit? If the pte_addr_t only had the high 32 bits of the 36-bit pointer, it would point to a pair of the 8-byte PTEs in a 16-byte chunk of RAM. Then simply examine the PTEs to see which one is the correct one.

Quoted 1 line · Andrew Morton

They might both map the same page. It could overflow into page->flags.

An overflow area for the 33rd bits in pte_chains is another idea. A CONFIG_HIGHMEM32G is another. But Hugh's and/or Andrea's code sounds nicer than either of those. It doesn't get smaller than 0.

-- wli

#3 lore raw
In reply to Albert Cahalan
Quoted 3 lines · Albert Cahalan

When handling 64 GB on i386, pte_addr_t really only needs 33 bits to find the PTE. It sure doesn't need the full 64 bits it is using.

Alternatively, limit the amount of memory supported to 32GB ;)

With only 1GB of lowmem you can't support much more than that anyway. The RHEL3 -smp kernel limits itself to 32GB in order to have a smaller pte_addr_t.

For larger systems there's the -hugemem kernel, which has Ingo's 4:4 split enabled.

Signature · 3 lines
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan