[LTP] [PATCH] mtest01: fix max_pids formula
Cyril Hrubis
chrubis@suse.cz
Wed May 3 14:44:56 CEST 2017
Hi!
> Values returned by sysinfo() are in multiple of mem_unit bytes.
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
> testcases/kernel/mem/mtest01/mtest01.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/mem/mtest01/mtest01.c b/testcases/kernel/mem/mtest01/mtest01.c
> index f3fba044c529..6225d7d7b671 100644
> --- a/testcases/kernel/mem/mtest01/mtest01.c
> +++ b/testcases/kernel/mem/mtest01/mtest01.c
> @@ -152,7 +152,8 @@ int main(int argc, char *argv[])
> total_free = sstats.freeram + sstats.freeswap;
> /* Total Free Pre-Test RAM */
> pre_mem = sstats.mem_unit * total_free;
> - max_pids = total_ram / (unsigned long)FIVE_HUNDRED_MB + 10;
> + max_pids = total_ram * sstats.mem_unit
> + / (unsigned long)FIVE_HUNDRED_MB + 10;
Looks OK.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list