[LTP] [PATCH 2/3] libswap: Add {SAFE_, }MAKE_MINIMAL_SWAPFILE() macros

Cyril Hrubis chrubis@suse.cz
Thu Apr 18 17:39:19 CEST 2024


Hi!
> Maximum kernel page size is 256KiB (see kernel arch/Kconfig). Therefore
> this is the minimum blocks allowed to be used to avoid warning on any
> kernel page size setup:
> 
>     TWARN: Swapfile size is less than the system page size. Using page size
>     (65536 bytes) instead of block size (4096 bytes).
> 
> Therefore define this size and add helper macros.

I'm again, slightly againts the use of disk block size as a base measure
of size. In practice the block size will either be 4k or 64k but it's
quite confusing to justify the need for 256 blocks. With 256 blocks the
minimal size will be either 1MB or 16MB depending on the actual
filesystem. So rather than that can we just default to 1MB minimal swap
file, which makes the test a bit more predictable?

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list