
Originally Posted by
Obscene_CNN
According to the kernel docs, in most cases memory isn't wasted. If you were to alloc 4MB of ram and only use 1 byte it would waste ram. If you alloc 4K of ram and and use just one byte it would be no worse than it is now.
Well it's worse because unless you're using the latest a greatest CPU the number of TLB entries for hugepages is pretty small:
Code:
TLB info
Instruction TLB: 4x 4MB page entries, or 8x 2MB pages entries, 4-way associative
Instruction TLB: 4K pages, 4-way associative, 128 entries.
Data TLB: 4MB pages, 4-way associative, 32 entries
L1 Data TLB: 4KB pages, 4-way set associative, 16 entries
L1 Data TLB: 4MB pages, 4-way set associative, 16 entries
Data TLB: 4K pages, 4-way associative, 256 entries.
This is a C2D T7500; so wasting a 4MB page creates more TLB pressure than wasting a 4KB page.