Microbenchmarking the page table isolation patches in Linux 4.4.13
2 min readJan 12, 2018
Running on Xeon W3580 CPUs (first generation i7, 3.33 GHz base). Kernel 4.14.13. One machine has Page Table Isolation compiled in and disabled on the commandline (“nopti”).
I will put the benchmarks for this on github this weekend, I promise!
No PTI:
216.6 nsec/call 17.5 user 199.0 sys: getrusage
190.0 nsec/call 21.1 user 168.9 sys: read
127.4 nsec/call 23.9 user 103.4 sys: read1bdevzero
783.0 nsec/call 25.0 user 758.0 sys: read8kdevzero
PTI:
542.1 nsec/call 172.1 user 369.9 sys: getrusage
600.5 nsec/call 145.7 user 454.7 sys: read
536.8 nsec/call 166.5 user 370.3 sys: read1bdevzero
1194.8 nsec/call 157.8 user 1037.0 sys: read8kdevzero
All things page table changes from userland are looking better than that, but not good. Might be a problem for garbage collectors using them.
No PTI:
Size of mapped area for protect/segv tests: 8192 MB, 262144 cards
no touch by default
1403.5 nsec/call 63.6 user 1339.9 sys: mprotect_randloc
209.5 nsec/call 33.5 user 176.0 sys: mprotect_sameloc
3691.7 nsec/call 44.3 user 3647.5 sys: mmap_no_touch
268322.4 usec/call 27394000.0 user 240927000.0 sys 262144.000 hpf 0.000 spf: mmap_and_touch
cpu 2598 0 4013 23730505 3580 0 290 0 0 0
4618.2 nsec/call 304.6 user 4313.3 sys 0.938 hpf 0.000 spf: trigger_segfaults
(101538 segfaults, 108267 writes, watch collision ratio)
cpu 2601 0 4061 23730864 3580 0 290 0 0 0
792.9 nsec/call 85.6 user 707.3 sys: madvise_randloc
1386.6 nsec/call 80.4 user 1306.1 sys: mprotect_randloc
with touch by default
12.0 usec/call 1270.5 user 10778.9 sys 8.435 hpf 0.000 spf: mprotect_randloc
634.9 nsec/call 48.2 user 586.6 sys: mprotect_sameloc
3949.0 nsec/call 94.7 user 3854.4 sys: mmap_no_touch
268316.5 usec/call 23921000.0 user 244398500.0 sys 262144.000 hpf 0.000 spf: mmap_and_touch
cpu 2638 0 4457 23733898 3580 0 290 0 0 0
PTI:
Size of mapped area for protect/segv tests: 8192 MB, 262144 cards
no touch by default
1876.7 nsec/call 304.2 user 1572.6 sys: mprotect_randloc
612.3 nsec/call 237.6 user 374.7 sys: mprotect_sameloc
5099.0 nsec/call 316.4 user 4782.8 sys: mmap_no_touch
341625.5 usec/call 55585000.0 user 286046000.0 sys 262144.000 hpf 0.000 spf: mmap_and_touch
cpu 8148 0 9147 23718982 1028 0 394 0 0 0
5680.5 nsec/call 942.9 user 4737.6 sys 0.944 hpf 0.000 spf: trigger_segfaults
(83074 segfaults, 88021 writes, watch collision ratio)
cpu 8157 0 9193 23719362 1028 0 394 0 0 0
1191.0 nsec/call 307.2 user 883.7 sys: madvise_randloc
1867.1 nsec/call 292.7 user 1574.4 sys: mprotect_randloc
with touch by default
11.4 usec/call 1548.2 user 9834.8 sys 5.968 hpf 0.000 spf: mprotect_randloc
1018.3 nsec/call 230.2 user 788.2 sys: mprotect_sameloc
5449.8 nsec/call 334.9 user 5108.6 sys: mmap_no_touch
341527.5 usec/call 61519000.0 user 280016500.0 sys 262144.000 hpf 0.000 spf: mmap_and_touch
cpu 8231 0 9577 23722557 1028 0 394 0 0 0
Full logs:
- https://www.cons.org/pti/pti_off.log
- https://www.cons.org/pti/pti_on.log
- https://www.cons.org/pti/freebsd.log
Code coming.