5 ms·
Transparent huge pages and memory usage
- TerryADavis 12y agoTempleOS was designed not to use paging because the extra levels of look-up slow things down. With 4 levels of paging, it must do 5 accesses for every memory reference. Long mode requires paging. This sucks. I identity-map everything just as though paging is not used. The VGA 0xA0000-0xBFFFF must be write-through, so I use granularity of 4K for the lowest 2Meg. Everything else is identity-mapped using 2Meg pages. I think it makes a difference on performance if you run code out of 4K or 2Meg pages. Perhaps, I should move my kernel out of the lowest 2Meg which is 4K mapped and into the 2Meg mapped size memory. On some machines, there are 1 Gig pages. I could use those and might be faster still, but I don't think all machines support them. I am going to command Intel to make non-paging long mode and optimize for it.
- nwmcsween 12y agoSounds like either a bug in how Linux handles MADV_DONTNEED or within transparent hugepages, remember you can still have thp if you set the kernel to do so using madv_hugepage.