Iso kernel (Linux 5.4.60), Iso hardware, Iso config apart from case A: CONFIG_PAGE_TABLE_ISOLATION=y and, case B: CONFIG_PAGE_TABLE_ISOLATION=n
iomem reports an identical map (apart from Kernel code size being marginally lower in case B)
cat /proc/meminfo reports MemTotal case B < MemTotal case A (about 20K)
Of course I understand that it is totally marginal. However, I would like to know how disabling KPTI (Kernel Page Table Isolation) can decrease MemTotal.
(Of course I crosschecked several time.)
EDIT : More detailed info under mainline Linux 5.4.66 (x86_64) :
CASE A (CONFIG_PAGE_TABLE_ISOLATION=y) :
8.166.984 KB memtotal (as reported by /proc/meminfo)
Memory: 8163640K/8387700K available (8194K kernel code, 415K rwdata, 1528K rodata, 776K init, 788K bss, 224060K reserved, 0K cma-reserved) (as reported at bootime)
CASE A' (CONFIG_PAGE_TABLE_ISOLATION=y) but boot nopti :
No change from the above reports ????
CASE B (CONFIG_PAGE_TABLE_ISOLATION=n) :
8.166.964 KB memtotal (as reported by /proc/meminfo) => -20KB / CASE A ???
Memory: 8163640K/8387700K available (8194K kernel code, 407K rwdata, 1528K rodata, 756K init, 816K bss, 224060K reserved, 0K cma-reserved)
In other words :
- 8K smaller data segment, 20K smaller init for a 8+20 increase of the bss segment.
To add to the initial question which remains (for me the more iportant) :
1/ How comes unsetting CONFIG_PAGE_TABLE_ISOLATION reduces memtotal by 20K ?
2/ Where are the 2MB of RAM consumed as announced in the §15.3 of the documentation ?
3/ How comes booting nopti does not have the same impact on kernel's memory than unsetting CONFIG_PAGE_TABLE_ISOLATION ?