Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1629875pxb; Sat, 16 Oct 2021 15:17:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSYwwwpeT8Pb+uLFSIK9E0FeB1zLEHCeoL6vqnDahOIBXHIkNjI6baF/nz6Ku6YBxRnvuw X-Received: by 2002:a17:906:2bd5:: with SMTP id n21mr18127131ejg.337.1634422678167; Sat, 16 Oct 2021 15:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634422678; cv=none; d=google.com; s=arc-20160816; b=xlk0QmOSwZ0LQHVK0vyPA3nIasAhVB3ET68tw/g8R7egwxfKSYqWSXy1BXt4ALhQ9D Qi1xIh2kH3sSPC5K8Bw8sCjA/+ZHGkkubDjYlAq0YQDo0OjGp5bham1bny/OG9x0QbhL AUOAYtfxz8F8N7NhMMkVWZQMjlLiT+T9KdqSA7SlbjSbUpb2pbfsswChyWpvUVog4M9D uyPKAfQMoG7etHbo4MvUQnkeQrpQgUMP2zHhHLknXtr0sw7ys+fV5C2Qe5c1Dc4WM80C 5X88adXOucatq+jm6kX04qxpHw1+RMrV/Wf8zdyJqPTo1NBoXY2El/cvVnd9Bkd9c1sg W3Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=K3e3fPc7t2heMZulUyPXuSYTrB88WAMaLXw51fmC8FI=; b=VOL0YLRIbORUlufN8+4UQbbDcbW0M2gSzh/vUHMeLOv5HUCPBa0izKJyMVd0g9rwPG hccw8ekJajp82JiUQbvqq+s8NwgUleH8klDhmZSF4ZoinRmYl3QoH/7Erh3iwuPv9vgX 4kuft2Wl6RbP1+m74wynhdneKcHdvc6LjXF8WeNBa7xHzsfHyjdvN/uRd1WXxX15yJRH +JR8pvHxeZVeQ5J2Zrl5i03KgSIVqPKtzrtewL99wxVbWsm9zB/wrThmVNbfGzXGXyVU 8zLj16JPhN/la4K/eVcUgkv8gUGC7D+FIJ0iy7Va56e6UyRbdcRRzCjt6Crtn2mJF2Z0 GiAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=GwmgesfT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si12933650edv.90.2021.10.16.15.17.34; Sat, 16 Oct 2021 15:17:58 -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=@linuxfoundation.org header.s=google header.b=GwmgesfT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230146AbhJOPkd (ORCPT + 99 others); Fri, 15 Oct 2021 11:40:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232848AbhJOPkd (ORCPT ); Fri, 15 Oct 2021 11:40:33 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4822C061762 for ; Fri, 15 Oct 2021 08:38:26 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id m20so8175813iol.4 for ; Fri, 15 Oct 2021 08:38:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=K3e3fPc7t2heMZulUyPXuSYTrB88WAMaLXw51fmC8FI=; b=GwmgesfT4HkmXK0wRnLzI8Byt0N60D5PL8+cgcMIf+AHXxyISkp0pPGNX4KIRpncv1 WrMtVkt4aLnr1E1A5J9vBXSiF4VcdBOBbwBzFeewoOtuRgaI0v3TC4t7yDhrajLM3DeO p//CWbSkmbzfyDg3MghT0eKiTPkk9FdrqvEqU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=K3e3fPc7t2heMZulUyPXuSYTrB88WAMaLXw51fmC8FI=; b=Ng34XFfSeDOc4hcmp7Y10gh1D2LarBLTuPlol/wPpfX7X56CchidM0c4Vu96aDkCsP VKGWSrA6UagwBr/JC7tKVONSRHuqnu82b8x1yJlH7YBb0CuFpZmntKvMYgX/aSYHfhok YfO3FsTr2oTGV5Ug9it1HrLfA8YsKRusKFxTZ/Pky5LPwhLS39mnSPFrFQ3RHDilfBkP qnqYIf8lJ2TjLQ6pCWvBtel2PhKWvvn/NOTs0gbkLisOet0hlgaRlwXqUssRUiz83/l+ nVxfuZKD06KT1WKf8O9wR1R4crrJVd94byTWqyBrnxEUszBfn88PdQr47k22nLpDOx13 H3QQ== X-Gm-Message-State: AOAM531WDOYq1X4/n7+OLzwGiXN0MbiX6Uf2GUr6lFjSN7gbvrjnGpqT 1kQsc7jrEUpDGXEyobKa/CvUgw== X-Received: by 2002:a5e:c018:: with SMTP id u24mr4159426iol.197.1634312306057; Fri, 15 Oct 2021 08:38:26 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id v26sm1980979iox.35.2021.10.15.08.38.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Oct 2021 08:38:25 -0700 (PDT) Subject: Re: [RFC][PATCH] selftests/vm/transhuge-stress: fix ram size thinko To: "George G. Davis" , Shuah Khan , "open list:KERNEL SELFTEST FRAMEWORK" , open list , Andrew Morton Cc: Eugeniu Rosca , "George G. Davis" , Shuah Khan References: <20210825135843.29052-1-george_davis@mentor.com> From: Shuah Khan Message-ID: <41be8425-761b-fa55-40c5-687b397e8ad2@linuxfoundation.org> Date: Fri, 15 Oct 2021 09:38:24 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210825135843.29052-1-george_davis@mentor.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Andrew! Would you like me to take this through kselftest tree? thanks, -- Shuah