Huge pages part 5: A deeper look at TLBs and costs
Huge pages part 5: A deeper look at TLBs and costs
Posted Mar 25, 2010 2:44 UTC (Thu) by ken (subscriber, #625)Parent article: Huge pages part 5: A deeper look at TLBs and costs
Running calibrator with size 13631488: 7 cycles 4.68 ns
Running calibrator with size 17563648: 7 cycles 4.65 ns matched 1 times
Running calibrator with size 21495808: 7 cycles 4.65 ns matched 2 times
Running calibrator with size 25427968: 7 cycles 4.68 ns matched 3 times
TLB_MISS_LATENCY_TIME=4.68
TLB_MISS_LATENCY_CYCLES=7
TLB_MISSES_COST_ONE_SECOND=228571428
-----------
I'm amazed it only takes 7 cycles. How is TLB really handle on x86 ??? I'm only familiar with PowerPC and there there is an actual exception and software that reloads the TLB and that can't be even close to 7 cycles at least not on the models I have worked with.
Posted Mar 26, 2010 1:38 UTC (Fri)
by sync (guest, #39669)
[Link] (1 responses)
My old Athlon XP 2000MHz has 5 cycles!
Running calibrator with size 13631488: 5 cycles 2.57 ns
TLB_MISS_LATENCY_TIME=2.57
And many thanks to Mel for this wonderful series.
Posted Mar 31, 2010 17:31 UTC (Wed)
by jzbiciak (guest, #5246)
[Link]
On Athlons, at least, there's a hardware table walk and a two-level TLB structure. It wouldn't surprise me to find out that the 5 cycle number you report is the average cost of missing the L1 TLB (frequent, fast) and L2 TLB (less frequent, but slower).
Huge pages part 5: A deeper look at TLBs and costs
Mine gives 7 cycle too
Running calibrator with size 17563648: 5 cycles 2.59 ns matched 1 times
Running calibrator with size 21495808: 5 cycles 2.58 ns matched 2 times
Running calibrator with size 25427968: 5 cycles 2.57 ns matched 3 times
TLB_MISS_LATENCY_CYCLES=5
TLB_MISSES_COST_ONE_SECOND=400000000
Huge pages part 5: A deeper look at TLBs and costs