[PATCH] arm: Do not add padding alignment for hugetlbfs backed memory

Will Deacon will at kernel.org
Thu Apr 6 08:51:51 PDT 2023


On Wed, 5 Apr 2023 12:09:05 +0100, Suzuki K Poulose wrote:
> The arm code tries to align the memory allocation size to 2M to potentially
> make use of the transparent hugepages. But this would be problematic if we
> try to allocate from the hugetlbfs, where the allocation size could be more than
> 2M. Given we support upto 1G, let use leave it to the user to align the
> requested memory when hugetlbfs is used.
> 
> Without the patch:
>  $ echo 1 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages
>  $ mount -t hugetlbfs -o pagesize=1G none /root/hugemem/
>  $  lkvm run -m 1024 --hugetlbfs /root/hugemem/  ...
>    # lkvm run -k ...  -m 1024 -c 6
>    Fatal: Can't ftruncate for mem mapping size 1075838976
> 
> [...]

Applied to kvmtool (master), thanks!

[1/1] arm: Do not add padding alignment for hugetlbfs backed memory
      https://git.kernel.org/will/kvmtool/c/77b108c6a6f1

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev



More information about the linux-arm-kernel mailing list