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

Petr Vorel pvorel@suse.cz
Thu Apr 18 20:14:11 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?

Makes sense, I'll send v2.

Kind regards,
Petr


More information about the ltp mailing list