lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 28 Sep 2021 13:58:54 -0400
From:   "George G. Davis" <george_davis@...tor.com>
To:     Shuah Khan <shuah@...nel.org>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
CC:     Eugeniu Rosca <erosca@...adit-jv.com>,
        "George G. Davis" <davis.george@...mens.com>
Subject: Re: [RFC][PATCH] selftests/vm/transhuge-stress: fix ram size thinko

On Wed, Aug 25, 2021 at 09:58:43AM -0400, George G. Davis wrote:
> From: "George G. Davis" <davis.george@...mens.com>
> 
> When executing transhuge-stress with an argument to specify the virtual
> memory size for testing, the ram size is reported as 0, e.g.
> 
> transhuge-stress 384
> thp-mmap: allocate 192 transhuge pages, using 384 MiB virtual memory and 0 MiB of ram
> thp-mmap: 0.184 s/loop, 0.957 ms/page,   2090.265 MiB/s  192 succeed,    0 failed
> 
> This appears to be due to a thinko in commit 0085d61fe05e
> ("selftests/vm/transhuge-stress: stress test for memory compaction"),
> where, at a guess, the intent was to base "xyz MiB of ram" on `ram`
> size. Here are results after using `ram` size:
> 
> thp-mmap: allocate 192 transhuge pages, using 384 MiB virtual memory and 14 MiB of ram
> 
> Fixes: 0085d61fe05e ("selftests/vm/transhuge-stress: stress test for memory compaction")
> Signed-off-by: George G. Davis <davis.george@...mens.com>
> ---
>  tools/testing/selftests/vm/transhuge-stress.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/vm/transhuge-stress.c b/tools/testing/selftests/vm/transhuge-stress.c
> index fd7f1b4a96f9..5e4c036f6ad3 100644
> --- a/tools/testing/selftests/vm/transhuge-stress.c
> +++ b/tools/testing/selftests/vm/transhuge-stress.c
> @@ -79,7 +79,7 @@ int main(int argc, char **argv)
>  
>  	warnx("allocate %zd transhuge pages, using %zd MiB virtual memory"
>  	      " and %zd MiB of ram", len >> HPAGE_SHIFT, len >> 20,
> -	      len >> (20 + HPAGE_SHIFT - PAGE_SHIFT - 1));
> +	      ram >> (20 + HPAGE_SHIFT - PAGE_SHIFT - 1));

Ping, any comments on this?

For the record, as noted, the value reported for "ram size" appears to
use the wrong variable, `len`, where `ram` should be used instead.

>  
>  	pagemap_fd = open("/proc/self/pagemap", O_RDONLY);
>  	if (pagemap_fd < 0)
> -- 
> 2.17.1
> 

-- 
Regards,
George

Powered by blists - more mailing lists