My laptop runs Ubuntu:22.04 LTS with the latest kernel image:
uname -a: Linux law 6.2.0-36-generic #37~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 9 15:34:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Such a kernel image uses memory folios. Indeed, if I run:
As you can see, my kernel gives me a huge page instead of a 4kb page. However, if I create a container with the same distro, i.e., Ubuntu:22.04, the memory page returned is a 4bk page instead of a huge one. Here the line of strace that returns a 4kb page:
Description
My laptop runs Ubuntu:22.04 LTS with the latest kernel image:
uname -a: Linux law 6.2.0-36-generic #37~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 9 15:34:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Such a kernel image uses memory folios. Indeed, if I run:strace tail -f /dev/null
I can spot the mmap syscall for the libc:
mmap(NULL, 2260560, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f7b48a00000
As you can see, my kernel gives me a huge page instead of a 4kb page. However, if I create a container with the same distro, i.e., Ubuntu:22.04, the memory page returned is a 4bk page instead of a huge one. Here the line of strace that returns a 4kb page:
mmap(NULL, 2260560, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb66550d000
Any guess? Can I somehow enable memory folios?
Reproduce
Dockerfile:
FROM ubuntu:22.04 RUN apt-get update && apt-get install -y strace
Commands:
docker build -t fail_folios .
docker run -it fail_folios
strace tail -f /dev/null
Memory pages returned are not huge pages.
Expected behavior
memory pages should
docker version
docker info
Diagnostics ID
Not available
Additional Info
No response