Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2435738pxb; Sun, 17 Oct 2021 15:04:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2SBHb1Qq4AiOboc9muvP2jBJ3PK71tvStni717VNDHvb/nOA7vtmlrkkIc4i/q1RlT0zz X-Received: by 2002:a17:90a:d801:: with SMTP id a1mr42890374pjv.109.1634508258440; Sun, 17 Oct 2021 15:04:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634508258; cv=none; d=google.com; s=arc-20160816; b=krhkV7VgEMkmd8uI8T466ALLv+DTHfOevf6zotIt1lMAXQWo5LLPsTym6AstOEBFk8 S4jt+UGqZo1S3i5kFcSiUypAtFlmq3+eIvhmmTLbyzCfjndqmXm+RrkoSIFXYPL9h6lS ETWKkEu++OY8e8Z3IEbndHtBaCjHnPDXWkdNpZLGb7yZ4Y0y1rNd39YO8kPh6BI/ggHI qe0Ac8cBd8Cm7tWQKLHerz9uX717nAhkHyNwyPo1RQaiFS2289Aq9/g4W3qMM3CnyS9b H2eFt/6jZ9eYkJeAM2uuclG1F94in+E4AUXQSUmNpCJfHOfxCSoFMOKgnAXiJrCuq7TR R3vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=OyeLy4thWqce+d4BtUfwmFKkZwwVhbym+X/GaaDev1U=; b=yJRc3PAKr9FpZk+KD83kuAZ1Ot0MWCywYbEAc/jwEM634RZK3f+2d0Dsw0CWj4ubek FkU3VIk5hPswCUs9x/h0mUlm04c1AxW87kALLzeBuCYHY5DnR9PFWvxL2qNJbixTw55w myOuPMrTaanSxO4I653fbdEzbBKg7oaRP3cVQR4CMFxsd8Gtaxtr1zDmUsVWog9W1gPi PW2Xxfml1E3m0mCibnhd+BeYOGAaShh4kzs0bf5E86d0Wk0aYbvmKI01/VejlsqxSqNx 06VmvKHmWlwmpN4WydMx1zj/p8tRMSXVc2LAOmGprp8CoGRawrmSJ++tnOx2tjKBl8xK /3bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=DsnBwVbi; 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 e17si16653751pgk.193.2021.10.17.15.03.52; Sun, 17 Oct 2021 15:04: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; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=DsnBwVbi; 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 S242674AbhJOTba (ORCPT + 99 others); Fri, 15 Oct 2021 15:31:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:41578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235265AbhJOTbW (ORCPT ); Fri, 15 Oct 2021 15:31:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB9A461151; Fri, 15 Oct 2021 19:29:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1634326156; bh=3JS/1kbwClvIz4bw9kp2a/P9fTD2/8UbJaeK5lJxnkE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DsnBwVbi/py5VyDgLutJnKvgeqNbFgDvx0Zz4vICvFjeLGosgjY4Ycv+xb7CRY8Sr AMAD0Rjun8jZyoTyj+OTinSaI029/rK6FHalqQJkQ/RiEOTLVWUCRxfnTJU9DXo8dw Hxb+Z6cuMsUwa2c7cyJKBOdFFPQupnhIBj7roG6s= Date: Fri, 15 Oct 2021 12:29:12 -0700 From: Andrew Morton To: Shuah Khan Cc: "George G. Davis" , Shuah Khan , "open list:KERNEL SELFTEST FRAMEWORK" , open list , Eugeniu Rosca , "George G. Davis" , Konstantin Khlebnikov Subject: Re: [RFC][PATCH] selftests/vm/transhuge-stress: fix ram size thinko Message-Id: <20211015122912.d42e5a8c41d623b544f7dd38@linux-foundation.org> In-Reply-To: <41be8425-761b-fa55-40c5-687b397e8ad2@linuxfoundation.org> References: <20210825135843.29052-1-george_davis@mentor.com> <41be8425-761b-fa55-40c5-687b397e8ad2@linuxfoundation.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 Oct 2021 09:38:24 -0600 Shuah Khan wrote: > On 8/25/21 7:58 AM, 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)); > > > > pagemap_fd = open("/proc/self/pagemap", O_RDONLY); > > if (pagemap_fd < 0) > > > > Sorry for the delay on this. The change looks good to me. Konstantin, coould you please take a look? > Andrew! Would you like me to take this through kselftest tree? Is OK thanks - I'll add it to my mm/thp pile.