aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorCharlie Jenkins <charlie@rivosinc.com>2024-01-30 17:07:00 -0800
committerPalmer Dabbelt <palmer@rivosinc.com>2024-03-14 08:46:13 -0700
commitb5b4287accd702f562a49a60b10dbfaf7d40270f (patch)
treedc21c2a0d259a1b4e3a07fded36c30fe505ea09b /tools
parent556e2d17cae620d549c5474b1ece053430cd50bc (diff)
downloadlinux-b5b4287accd702f562a49a60b10dbfaf7d40270f.tar.gz
riscv: mm: Use hint address in mmap if available
On riscv it is guaranteed that the address returned by mmap is less than the hint address. Allow mmap to return an address all the way up to addr, if provided, rather than just up to the lower address space. This provides a performance benefit as well, allowing mmap to exit after checking that the address is in range rather than searching for a valid address. It is possible to provide an address that uses at most the same number of bits, however it is significantly more computationally expensive to provide that number rather than setting the max to be the hint address. There is the instruction clz/clzw in Zbb that returns the highest set bit which could be used to performantly implement this, but it would still be slower than the current implementation. At worst case, half of the address would not be able to be allocated when a hint address is provided. Signed-off-by: Charlie Jenkins <charlie@rivosinc.com> Link: https://lore.kernel.org/r/20240130-use_mmap_hint_address-v3-1-8a655cfa8bcb@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions