[LTP] [PATCH] inode01: Drop redundant 512MB dev_min_size requirement
Wake Liu
wakel@google.com
Thu Nov 19 14:48:25 CET 2026
Hi Avinesh,
On Thu, Nov 19, 2026 at 02:01:21PM +0100, Avinesh Kumar wrote:
> Unfortunately this change breaks things on tmpfs on systems with 64k
> pagesize, as library sets
> if (!tst_test->dev_min_size)
> tmpfs_size = 32;
...
> so either we need to revert this patch or we can do this lib change
>
> (lib/tst_test.c)
>
> - if (!tst_test->dev_min_size)
> - tmpfs_size = 32;
> - else
> + if (!tst_test->dev_min_size) {
> + /*
> + * tmpfs charges its size in whole pages, so 32MB is only 512
> + * pages with 64kB pages instead of 8192 with 4kB ones. Scale
> + * it to keep the same page budget on every architecture.
> + */
> + tmpfs_size = 32 * MAX(getpagesize() / 4096, 1);
> + } else {
> tmpfs_size = tdev.size;
> + }
Thanks for catching this!
I agree with updating limit_tmpfs_mount_size() in lib/tst_test.c rather
than reverting. Reverting to .dev_min_size = 512 would bring back loop
backing file ENOSPC failures on storage-constrained systems (and even
.dev_min_size = 300 would only provide 4800 pages with 64kB pages, still
short of the 5460 non-empty files created at peak in inode01).
Scaling the default 32MB tmpfs limit by getpagesize() / 4096 keeps a
consistent 8192-page budget across 4kB (32MB), 16kB (128MB, which also
matters for 16kB-page Android kernels), and 64kB (512MB) systems while
preserving the 2x MemAvailable TCONF guard for low-memory machines.
Since the fix and comment are yours, will you be sending this as a
formal patch? Feel free to add my:
Reviewed-by: Wake Liu <wakel@google.com>
(Or let me know if you prefer that I send it out with your
Suggested-by.)
Thanks,
Wake
More information about the ltp
mailing list