[LTP] [RFC PATCH] fallocate05: increase the fallocate and defallocate size

Li Wang liwang@redhat.com
Thu Sep 23 08:29:17 CEST 2021


> A simple way to verify my assumption, you can try:
>
> --- a/testcases/kernel/syscalls/fallocate/fallocate05.c
> +++ b/testcases/kernel/syscalls/fallocate/fallocate05.c
> @@ -147,7 +147,7 @@ static void cleanup(void)
>  static struct tst_test test = {
>         .needs_root = 1,
>         .mount_device = 1,
> -       .dev_min_size = 512,
> +       .dev_min_size = 64,
>         .mntpoint = MNTPOINT,
>         .all_filesystems = 1,
>         .setup = setup,
>


Or, another way I can think of, is to cancel the tmpfs size limitation
when MemFree is less than the twofold size to be mounted.

(I guess guarantee twofold size MemFree is safe enough for avoiding OOM)


--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -895,6 +895,9 @@ static const char *limit_tmpfs_mount_size(const char
*mnt_data,
        if (strcmp(fs_type, "tmpfs"))
                return mnt_data;

+       if ((SAFE_READ_MEMINFO("MemFree:") / 1024) < (tdev.size * 2))
+               return mnt_data;
+
        if (mnt_data)
                snprintf(buf, buf_size, "%s,size=%luM", mnt_data,
tdev.size);
        else


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210923/00beb778/attachment.htm>


More information about the ltp mailing list