3 ms·
What about page size?
by edflsafoiewq 7mo ago
What about page size?
- ori_b 7mo agoIt's 4k on x86 as well. Doesn't seem to hurt so bad -- at least, not enough to explain the risc-v performance gap.
- twoodfin 7mo agoHmm? x86 has supported much larger “huge” page sizes for ages.
- ori_b 7mo agoYes, and Linux. at least historically, has not used them without explicit program opt-in. Often advice is to disable transparent huge pages for performance reasons. Not sure about other operating systems. See, for example, https://www.pingcap.com/blog/transparent-huge-pages-why-we-disable-it-for-databases/ https://www.pingcap.com/blog/transparent-huge-pages-why-we-d...
- jorvi 7mo agoHuh, no? The usual advice is to enable THPs for performance, you only disable them in specific scenarios.
- wren6991 7mo agoYep, RISC-V also has these megapages. 4k is the last-level page size. You get larger pages (4M on 32-bit and 2M/1G on 64-bit) by terminating the walk at higher levels of the page table.
- jabl 7mo agox86 has decades of knowhow and a zillion transistors to spend on making the memory pipeline, TLB caching & prefetching etc. etc. really really good. They work as well as they do despite the 4k base page size, not because of it. If you'd start from a clean sheet today you'd probably end up with a somewhat bigger base page size. Not hugely larger though, as that wastes a lot of memory for most applications. Maybe 16k like some ARM chips use?
- rwmj 7mo agoRISC-V has the Svnapot extension for large page sizes https://riscv.github.io/riscv-unified-db/manual/html/isa/isa_20240411/exts/Svnapot.html https://riscv.github.io/riscv-unified-db/manual/html/isa/isa...