Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1824231pxk; Fri, 2 Oct 2020 22:25:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1mU63fgaMHgxTYuT87cV6SKaCsrXBrAnx8tFQeXwg2El1BeFeArZ4QOPwN+VUBCwrL5G+ X-Received: by 2002:a17:906:6c82:: with SMTP id s2mr5454147ejr.182.1601702757186; Fri, 02 Oct 2020 22:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601702757; cv=none; d=google.com; s=arc-20160816; b=he+jIIQP/wuUOWJuDRx1oxB3w/Hm16bXeVmNtV4QJ+pYeHbU4s+nrOwADL55tEc/5P isUQhWw4OLotjxKEv9WR4Agd/jeDwsKJrLY9oSJkmDfyskKo2lKDvXF99HNyc19wFVgj eZ1r0rgj5XqPWHsWvIbMQRHTT2yKGygtIc/v4JJHy6/9amZLcKLXcQBqBIUDa8B7xSl1 jL8A7foP2Kmxa4eqCbYaDO29WM4FrROJJVGN1+8zatvv4G8C25XMN6fksbCMKBqfBUSA YZiqOYgSoatvDHwjKieFSP2+rnMcB1AXLmUnSPIHl9my+KQr8yyqdhf41fgZ8EcQtPEm Rung== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1SGTXRb4W2GeXcOMkx7sItuBro8o/9vcs+gJu2aYrQY=; b=sgfdLQ+sMjHRBY1YfAc/G11YRQc4XwyNHrCu3eJ6sAA2XGLl3m7Vh7s5E2hhGzq9sz ndbIcRQXmdu1kB9uck3SS4BkczWVZPqqV+v3fM7Ci/RDxaGS28CqSWl31/WmzaNjAU6O Ip+skhp0Q82dAjI5xn9ldnTPOKRfn/OrxJsC0Ru/YsgThHiAUGfHcDg41i2ccx7AIr/U x+jc7T+cVrd2ZHv4/z3xT2yPJfhzh+xqYQ2MEd8uDlq+ugTpPUWztKGTC28BP+0HdMMA ogzn/WnqD6CVF7AEtRU42Ob2KneL4lmQGthEi9aNRxEadCDNeLAZX7KV30nk99uuu+QY lIOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lLlekOam; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si2841069ejp.403.2020.10.02.22.25.35; Fri, 02 Oct 2020 22:25:57 -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=@gmail.com header.s=20161025 header.b=lLlekOam; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725795AbgJCFXZ (ORCPT + 99 others); Sat, 3 Oct 2020 01:23:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725791AbgJCFXZ (ORCPT ); Sat, 3 Oct 2020 01:23:25 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 505B8C0613D0; Fri, 2 Oct 2020 22:23:25 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id md26so4578170ejb.10; Fri, 02 Oct 2020 22:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to; bh=1SGTXRb4W2GeXcOMkx7sItuBro8o/9vcs+gJu2aYrQY=; b=lLlekOam2VLJeeTUJ2KuRAGO50dUm7Rz8jwPJLC5yRWmFYzkbJzCBOzMTmZRPOh2BR YLB0m46SIPmfOkFbh4BkyB0LXGkNiOn5cDT7ABlu+4cHoML7iy8Ep5+RhFg5gRZW00nr yB30hQsdreZEoZtMdyUCnRX+7k5WUtOLCAcOW5gpm4f+QXqWBk8kAO5K0bOddhDkwNVa xjfIb21EoPtH8eRfG3UWS2gma2iEz9+qSLrE3ZDKTu/UiPL78/Ym3bpFIIhCdf/6sweo /Lc3nZG+XTZTBN/wjWz4Ut97bqOMWxs8PFWAIkwOLEFQRtONc25Rv3A6Dz4I43bZKcYf e6rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to; bh=1SGTXRb4W2GeXcOMkx7sItuBro8o/9vcs+gJu2aYrQY=; b=ZBYCrNHiaiT5crHqLzinRCilJG8fSKCmkcO0BcN0E3DmJtkMPhXgha+/bZs2y1Fr58 nZyFlMY2mLI56kRaAIfjnbOaJAyrX7TdaPdQXKd+WiMseTIpwZfxN5AlFL3RHv0fdDH/ ARdaiZC++s3sTUDRsnCCLHD3cppy3bG60OgiXsKGCf8l4+9HP2D7B+qwqExFd6fv3hhQ Vpu+MnwBwxFPmaYJEGvFWK6hnyXQW9KrOwow7xIT1YEU5cpZtSs4Vbed3pZGVRgGg8CM Oh/NbK0iwJagU0dnECQqEmfxQKL4QpDxhDvoY6PlwAja+jTNvzyJBGOW83j3NWW1PUmp CiCQ== X-Gm-Message-State: AOAM532AN9iPoFWQq4Qr+O6IhXccRwvAA4plPYTuWP7MzTm7KiLOG8Av Dhhz0oOXBLPVbRHusmJ5hs4= X-Received: by 2002:a17:906:3ad0:: with SMTP id z16mr5577080ejd.193.1601702604035; Fri, 02 Oct 2020 22:23:24 -0700 (PDT) Received: from localhost.localdomain ([2a02:2450:10d2:194d:dc80:74e3:612d:b241]) by smtp.gmail.com with ESMTPSA id q3sm3059309edt.1.2020.10.02.22.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 22:23:23 -0700 (PDT) From: SeongJae Park To: John Hubbard Cc: Andrew Morton , Shuah Khan , LKML , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Ralph Campbell Subject: Re: [PATCH] selftests/vm: 10x speedup for hmm-tests Date: Sat, 3 Oct 2020 07:23:09 +0200 Message-Id: <20201003052309.30013-1-sj38.park@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201003011721.44238-1-jhubbard@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2 Oct 2020 18:17:21 -0700 John Hubbard wrote: > This patch reduces the running time for hmm-tests from about 10+ > seconds, to just under 1.0 second, for an approximately 10x speedup. > That brings it in line with most of the other tests in selftests/vm, > which mostly run in < 1 sec. > > This is done with a one-line change that simply reduces the number of > iterations of several tests, from 256, to 10. Could this result in reduced test capacity? If so, how about making the number easily tweakable? Thanks, SeongJae Park > Thanks to Ralph Campbell for suggesting changing NTIMES as a way to get the > speedup. > > Suggested-by: Ralph Campbell > Signed-off-by: John Hubbard > --- > > This is based on mmotm. > > tools/testing/selftests/vm/hmm-tests.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/vm/hmm-tests.c b/tools/testing/selftests/vm/hmm-tests.c > index 6b79723d7dc6..5d1ac691b9f4 100644 > --- a/tools/testing/selftests/vm/hmm-tests.c > +++ b/tools/testing/selftests/vm/hmm-tests.c > @@ -49,7 +49,7 @@ struct hmm_buffer { > #define TWOMEG (1 << 21) > #define HMM_BUFFER_SIZE (1024 << 12) > #define HMM_PATH_MAX 64 > -#define NTIMES 256 > +#define NTIMES 10 > > #define ALIGN(x, a) (((x) + (a - 1)) & (~((a) - 1))) > > -- > 2.28.0