diff options
author | Charlie Jenkins <charlie@rivosinc.com> | 2024-01-31 02:07:00 +0100 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2024-03-14 16:46:13 +0100 |
commit | b5b4287accd702f562a49a60b10dbfaf7d40270f (patch) | |
tree | dc21c2a0d259a1b4e3a07fded36c30fe505ea09b /Documentation | |
parent | Merge tag 'ceph-for-6.8-rc1' of https://github.com/ceph/ceph-client (diff) | |
download | linux-b5b4287accd702f562a49a60b10dbfaf7d40270f.tar.xz linux-b5b4287accd702f562a49a60b10dbfaf7d40270f.zip |
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 'Documentation')
0 files changed, 0 insertions, 0 deletions