Describe the bug
On the AL2023 kernel-6.18 line, /dev (devtmpfs) is no longer capped at the fixed 4 MB it used to be on the kernel-6.12 line — it now defaults to ~50% of instance RAM, so it scales with instance size.
systemd requests /dev be mounted with size=4m on both kernels. On kernel <= 6.12 devtmpfs reapplied that option on each mount (via reconfigure_single()), so /dev was capped at 4 MB. Since kernel 6.15 it no longer reapplies mount options — /dev just reuses the kernel's original early mount, which has no size limit, so it defaults to ~50% of RAM and systemd's size=4m is silently ignored.
This is upstream commit cb0e0a8bf4e1 ("devtmpfs: replace ->mount with ->get_tree in public instance"), merged in Linux 6.15. It converted /dev to the new mount API and dropped the option-reapplication logic, effectively re-breaking the 2022 fix a6097180d884 ("devtmpfs regression fix: reconfigure on each mount"). The commit message says the new ->get_tree "simply takes an extra reference on the existing internal mount as before", so the change of behavior appears unintended.
To Reproduce
- Launch an instance from an AL2023 AMI on the kernel-6.12 line and run
findmnt /dev.
- Launch an instance of the same size from an AL2023 AMI on the kernel-6.18 line and run
findmnt /dev.
- Compare the
size= value.
Observed (two instances, same size, ~3830 MiB RAM, same systemd 252.23):
# kernel 6.12.83-113.160.amzn2023.aarch64
/dev devtmpfs devtmpfs rw,nosuid,seclabel,size=4096k,nr_inodes=479804,mode=755
# kernel 6.18.39-79.141.amzn2023.aarch64
/dev devtmpfs devtmpfs rw,nosuid,seclabel,size=1917144k,nr_inodes=479286,mode=755
On 6.18 the size is exactly the tmpfs "half of RAM" default (nr_blocks == nr_inodes == ~RAM/2 pages), confirming size=4m had no effect.
Expected behavior
Mounting /dev with size=4m should cap /dev at 4 MB, as it did on kernel 6.12 and earlier.
Environment
- OS: Amazon Linux 2023 (aarch64)
- Bad: kernel
6.18.39-79.141.amzn2023.aarch64, systemd 252.23-12.amzn2023
- Good: kernel
6.12.83-113.160.amzn2023.aarch64, systemd 252.23-11.amzn2023
Additional context
Questions:
- Is this a known/intended change in the AL2023 6.18 kernel?
- Any plan to carry a fix (restore option reapplication on the public
/dev mount)?
Note: size= on devtmpfs is a cap, not a memory reservation, so the larger value does not itself consume extra memory — but it is a user-visible behavior change and defeats the size/nr_inodes limits set on /dev.
Describe the bug
On the AL2023 kernel-6.18 line,
/dev(devtmpfs) is no longer capped at the fixed 4 MB it used to be on the kernel-6.12 line — it now defaults to ~50% of instance RAM, so it scales with instance size.systemd requests
/devbe mounted withsize=4mon both kernels. On kernel <= 6.12 devtmpfs reapplied that option on each mount (viareconfigure_single()), so/devwas capped at 4 MB. Since kernel 6.15 it no longer reapplies mount options —/devjust reuses the kernel's original early mount, which has no size limit, so it defaults to ~50% of RAM and systemd'ssize=4mis silently ignored.This is upstream commit cb0e0a8bf4e1 ("devtmpfs: replace ->mount with ->get_tree in public instance"), merged in Linux 6.15. It converted
/devto the new mount API and dropped the option-reapplication logic, effectively re-breaking the 2022 fix a6097180d884 ("devtmpfs regression fix: reconfigure on each mount"). The commit message says the new->get_tree"simply takes an extra reference on the existing internal mount as before", so the change of behavior appears unintended.To Reproduce
findmnt /dev.findmnt /dev.size=value.Observed (two instances, same size, ~3830 MiB RAM, same systemd 252.23):
On 6.18 the size is exactly the tmpfs "half of RAM" default (
nr_blocks == nr_inodes == ~RAM/2pages), confirmingsize=4mhad no effect.Expected behavior
Mounting
/devwithsize=4mshould cap/devat 4 MB, as it did on kernel 6.12 and earlier.Environment
6.18.39-79.141.amzn2023.aarch64, systemd252.23-12.amzn20236.12.83-113.160.amzn2023.aarch64, systemd252.23-11.amzn2023Additional context
Questions:
/devmount)?Note:
size=on devtmpfs is a cap, not a memory reservation, so the larger value does not itself consume extra memory — but it is a user-visible behavior change and defeats the size/nr_inodes limits set on/dev.