Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5129891pxb; Tue, 28 Sep 2021 11:08:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7+RiMnVI6XGEEF3ZZnmIookazM0WZEAiCXHj/98ZgBcznmk7ESSJDE7TvhIQNg59czE6P X-Received: by 2002:a17:906:2ed1:: with SMTP id s17mr8548858eji.261.1632852498496; Tue, 28 Sep 2021 11:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632852498; cv=none; d=google.com; s=arc-20160816; b=xXg5q/Rg3RFr9e3qsv2t4EY3SbpQzqeKEgrCT0V4TpViTf8VOrrzwGdr/h8rIjLorf MUAWB1HQPxm3VA8vTirsdF8gQbj0g+LE6T1l1bNyJsyMEoepfg/c68eQSVi2OIzU7YgD pTcCwGypCMC24EAjKnBGPqSHBlfV9NCePSC7LuMut0gBED0WqqGjxyeNJtkesbEq5lrT /XtsmbmrS1gCVCjlZCWVLCw8rV/6JxhwBdNBQT+XuAy9ikcEGRzRjBb1w8OdKk0uc0cU k+2CbTqKkwEV0gCr48qmLNWf3v8aPDFRYLzOYJLNKvu81oSgBYE++XV5CZ4DgqzTeBaz o9eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=rlRR8yelpfk4gGjbcnvM+4b/+sDbsovH6TuLFmfPDQM=; b=KSlojnvFRvDW34XO1tyLHddrZKUnT/Ladd31Xrh4Cor1fKD+MZAcZDKgjJBJN9rCmW xoA2XqC2iNWjhxnP7RJHrW/Hg3Mi9sIAAwuv69t64d4QcfajP/dex7gm5ctP4n/iUhGS AqmuyKdT55J/W0uURIujqQM1Q68lsROqVqlvNUM5/rpGVGHtOXsX0qf4S9JhNJ46J2pN fXR6NKdMXANZQZdKgUe2MKkAY70kdrZYhZQ2mk//XSijX7AYtru0OADwFqlFqZ/933ah HjNBn8l5O46/gkiSpOWXlaqc1thCzGXSfxt2FheSDQJ1OZA6p3B4ootqQfSg2mwWIDhu tvCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s12si13678855ejc.488.2021.09.28.11.07.52; Tue, 28 Sep 2021 11:08:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241547AbhI1SHu (ORCPT + 99 others); Tue, 28 Sep 2021 14:07:50 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:59192 "EHLO esa4.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241488AbhI1SHt (ORCPT ); Tue, 28 Sep 2021 14:07:49 -0400 X-Greylist: delayed 431 seconds by postgrey-1.27 at vger.kernel.org; Tue, 28 Sep 2021 14:07:49 EDT IronPort-SDR: mePWzU6XxdoUSOMA2/Jg70TZhHST4d58hbeNtM052Zs8/Jw3VDqV1RpfE8gQ92f+Bw/9qK/+uf xgByXnAzwfEnKvbJKli8N6A7PtNafcxfoAWMdbpzfIhc9F1sKaKUYquBoZfsS2rFF2l0PEx0Cg Mr2trBbNvzh/BDjAvLtW0Yrj+eHNJVl1w5yoqGT4Skm/232M4xXpZEjyu5KXOowDeXd63+17SN +cyrA9YlpjKPKUj1gQsA6Wlv5xmbhDOST91Aig515viFdB8UeILbdF6Bu8ksA2cuugPZU8RnQS o/7QX06ek+wnJmaC/bvPzxy0 X-IronPort-AV: E=Sophos;i="5.85,330,1624348800"; d="scan'208";a="66580246" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 28 Sep 2021 09:58:58 -0800 IronPort-SDR: Rj6wklur1DFVClW8MWEh16FKp27QeSbB/4UgZyZ13z3yEGPvxTkDUw8KEymMjqaBAHaQ4ZD2+i 6NZkJLRYanpjMoSxT/k4PEsmy6z2Tbd6SrSEQmHJFAT+HRdnWxcNKLK+VH5Zn5LIjz3YR3+KF/ gyqoFb22du8NW3uEPAeI/1z/vbe79/It4PomUlhtkGFwVe9EsegR0M5rfl1Ym3MmtcWyHWFxXi 4OzrzUJQzoZiCjIy6mlsFBS3UZElKVyHIT/rr17GhDGtIYWbgOf0iDw0znZM4snXyoiGsKQPZa ses= Date: Tue, 28 Sep 2021 13:58:54 -0400 From: "George G. Davis" To: Shuah Khan , "open list:KERNEL SELFTEST FRAMEWORK" , open list CC: Eugeniu Rosca , "George G. Davis" Subject: Re: [RFC][PATCH] selftests/vm/transhuge-stress: fix ram size thinko Message-ID: <20210928175854.GA7313@mam-gdavis-dt> References: <20210825135843.29052-1-george_davis@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20210825135843.29052-1-george_davis@mentor.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: svr-orw-mbx-04.mgc.mentorg.com (147.34.90.204) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 25, 2021 at 09:58:43AM -0400, George G. Davis wrote: > From: "George G. Davis" > > 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 > --- > 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