Page sizes supported by RISC-V

Maciej W. Rozycki macro at orcam.me.uk
Tue Jan 14 22:51:37 PST 2025


On Tue, 14 Jan 2025, Jeff Law wrote:

> >> I understand that not making a call in the specifications avoids the
> >> need to resolve these conflicts.  But if you don't define a maximum page
> >> size there, it is effectively specified as 4096 bytes.  This will cause
> >> problems if distributions targeting large systems want a larger page
> >> size because it better aligns with the kind of hardware they target.
> >> It's really bad for cross-distribution binary compatibility, something
> >> that's important outside the embedded space and probably necessary for
> >> mainstreaming.
> >>
> >> (Of course you know all this. 8-)
> > Yup.  Once it's baked into one significant distro, it's doing to be 
> > bloody hard to change.  I'm sure we both remember the PPC pagesize stuff 
> > from a few years back ;(
> > 
> > I strongly suspect the lack of specification here is mean to give 
> > degrees of freedom to the implementors, but sometimes those writing the 
> > specs don't really understand the implication of leaving things like 
> > this unspecified and how much pain it really causes in the end.
> So resurrecting this discussion.
> 
> Is there any realistic chance of bumping the minimum pagesize for risc-v 
> at this point?  Xu Lu and his team have some compelling data that 
> indicates moving forward to 64k could be highly profitable.  That work 
> was done on aarch64, but should be generally applicable to riscv as well.

 Can't we simply make a reasonable guess/assumption just for the purpose 
of tooling?

 For example MIPS hardware has supported page sizes of up to 256MiB since 
forever and ones of up to 256TiB since ~R3, but we chose to support sizes 
of up to 64KiB only on the software side.  And that was some 20 years ago, 
back when hardware resources were considerably more limited and therefore 
extra VM space consumption from getting things aligned to a larger page 
size was more painful.

 Based on the experience with MIPS/AArch64 shared here there should be no
disagreement as to going for at least 64KiB I suppose.  Then shall we go 
beyond to leave room for some expansion, such as for 256KiB?

  Maciej



More information about the linux-riscv mailing list