Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1729091pxk; Fri, 2 Oct 2020 18:18:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkXDgMUhRm8UIb2mh3uf5b48XXyiNgl5r2yk8hrX+QsoJDr6Li3YM9bGu8DsZKMQ1B03gE X-Received: by 2002:a50:fb15:: with SMTP id d21mr5822085edq.150.1601687925458; Fri, 02 Oct 2020 18:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601687925; cv=none; d=google.com; s=arc-20160816; b=YFzfE9KztxLnupLblKa0AhbVddhrKLuSAr8y4nHDapMtzkxp+PrF0g1e4r+cJ9UV2B tfNYKVga2j0hgfbpHDpgcrhtefRLguUhA/7v1SypZRAn1NM5EM2rCY7kCPLyxmprPKMa rjqXZpVcnmY46qY4rUad79YDbyq9vxcPy1z4/WZEOKxl/Ddy+d6gX2esvsb9nXvQFRlP snKqw9+XjzDssHTxYPsQb7heL+TdI2K8Vk6+6BN06aUe0HOaaWG/8LUTaG8KnYftUMWE Tb2KoqlBccH63RzgnMh8z3OT6btdc88mt9JJxarKpGLrNXLB/DXh+Ksw3jl1bTw2oHvk 8WoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=YW/NWGpa68jtDIRpTXUYduQIdru2AkHtxJU2AhNsM+0=; b=gJXAN4BRg6G8xK/5LIE/YZ4Xbj2Rb2SLlOa2uW8ZCWejmj+r0Y0eDvNntsszXpH30R Wf3oZcMrbYtFjgCS2g8llxZexykM961AZETTXDTq+VhD3XXjXL+OBYSAdq7iJ35T04EO nQyf10iSqRkFZ8g/BcaUa43iWGx3ExjsmlkFKQsD3zUgonzI1/cNdc5BOngCqkrq8xWq mzX8spWROu7CxjL+gCqYfihXcbxtY5j2+LWazzut1xAGauaUByeHS95G97jAIpjmxJol medlAAGXf769+rCTyJpJsoAyJCwgxuxi9+FpI4gqBFFI4y8Hdc8GFgFpHDHfVfplacSA xg0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="SoUIN9/u"; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si2139609ejf.427.2020.10.02.18.18.23; Fri, 02 Oct 2020 18:18:45 -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=@nvidia.com header.s=n1 header.b="SoUIN9/u"; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725793AbgJCBRY (ORCPT + 99 others); Fri, 2 Oct 2020 21:17:24 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:15319 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbgJCBRY (ORCPT ); Fri, 2 Oct 2020 21:17:24 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 02 Oct 2020 18:15:39 -0700 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sat, 3 Oct 2020 01:17:23 +0000 Received: from sandstorm.nvidia.com (172.20.13.39) by mail.nvidia.com (172.20.187.13) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Sat, 3 Oct 2020 01:17:23 +0000 From: John Hubbard To: Andrew Morton CC: Shuah Khan , LKML , , , John Hubbard , Ralph Campbell Subject: [PATCH] selftests/vm: 10x speedup for hmm-tests Date: Fri, 2 Oct 2020 18:17:21 -0700 Message-ID: <20201003011721.44238-1-jhubbard@nvidia.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-NVConfidentiality: public Content-Transfer-Encoding: quoted-printable Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601687739; bh=YW/NWGpa68jtDIRpTXUYduQIdru2AkHtxJU2AhNsM+0=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:MIME-Version: X-NVConfidentiality:Content-Transfer-Encoding:Content-Type; b=SoUIN9/u21hlPuWqGmiNhBACDJHJQd9Sn87vBzky3eLvGj5B72TVGaEHnYyH5QUlJ TMsVPyuYUtXFvaqPM6WIBfbsRs1PdRP6RdUW5E9XBUHNoCwz8QBmFhTc9xrde9QCZM NoqFEMU/8nEp7J1Hl4DKNYfMSNNl2m2yeOFGQEzeWrm4fXc8HtOZ9wSBLi6JFvUkY3 q04FbnaWAW4TLzb5xewaBBh0oMWBA8TGIXMf3E7RhejB8SdmomvxhKeiHlxgRbOzIy 9h4gnsKWzrQItebOvLEpeX4lQnyEhFQgD2B2k7oSndB3/3GMK0Qee3gntO4v0he4jV U1JzvDbLUk7OA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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/selftes= ts/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 =20 #define ALIGN(x, a) (((x) + (a - 1)) & (~((a) - 1))) =20 --=20 2.28.0