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

Cyril Hrubis chrubis@suse.cz
Thu Sep 23 15:09:59 CEST 2021


Hi!
> 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.

This would fail horribly if the machine has all RAM used but there is
plenty in buffers that should be freed.

I guess that we should really add tst_available_ram() function that
would print either MemAvailable or sum of MemFree + MemCached. And of
course we shouldn't eat more than half of that in the tests.

> --- 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;

I guess that we should as well skip the tmpfs completely if we think
that the size is too small as well.

>         if (mnt_data)
>                 snprintf(buf, buf_size, "%s,size=%luM", mnt_data,
> tdev.size);
>         else
> 
> 
> -- 
> Regards,
> Li Wang

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list