Tmpfs: iommu h/w support via huge pages memory alloc

With the following PR im trying to introduce (iommu supported) huge memory pages support for tmpfs (first step: /tmp backed by tmpfs).

On my lab I can reproduce a (for free) 2x speedbump and as well a significant drop in cpu load for large sequential data transfer from/to tmpfs /tmp drive across all systems.

# ( touch /tmp/test && rm /tmp/test && dd if=/dev/zero of=/tmp/test oflag=direct bs=16M count=256 && rm /tmp/test )
# default:   4294967296 bytes (4,3 GB, 4,0 GiB) copied, 2,04209 s, 2,1 GB/s
# hugepages: 4294967296 bytes (4,3 GB, 4,0 GiB) copied, 1,09119 s, 3,9 GB/s

But im not confidant about speed and compatibility impacts on other hardware platforms. Thats why my PR currently adds a new option, but leaves it off by default.

Huge memory pages support was introduced to linux with 2.5/2.6 kernel version and successfully used by enterprise db performance tuning. So I would see this part of the memory allocator as quite stable and battle proven now.

Qemu does not help with validation, because it will not correctly emulate the hardware iommu hardware on the target platform.

Aarch64 (eg. apple silicon. ampera), risc64, and numa x86_64 would be very interesting.

But any other hardware (with huge table / iommu) support would be welcome as well.

Thank you!

5 Likes

This sounds quite useful. I’ve got a couple x86_64 NUMA systems that I’ll spotcheck this on.

1 Like

I’ll look into this on Ampere Altra Max M128-26