From patchwork Sat Oct 3 01:17:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 11814809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6A797112E for ; Sat, 3 Oct 2020 01:17:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1C69C207DE for ; Sat, 3 Oct 2020 01:17:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="SoUIN9/u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C69C207DE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EB1266B005C; Fri, 2 Oct 2020 21:17:26 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E61506B005D; Fri, 2 Oct 2020 21:17:26 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D77CF6B0062; Fri, 2 Oct 2020 21:17:26 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id A718A6B005C for ; Fri, 2 Oct 2020 21:17:26 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2D37E1EE6 for ; Sat, 3 Oct 2020 01:17:26 +0000 (UTC) X-FDA: 77328851292.28.hope86_331646c271a8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 100056C05 for ; Sat, 3 Oct 2020 01:17:26 +0000 (UTC) X-Spam-Summary: 1,0,0,6a17e7ab0f65cd09,d41d8cd98f00b204,jhubbard@nvidia.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1437:1513:1515:1516:1518:1521:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3834:3865:3866:3867:3870:3871:3872:3874:4250:4321:4560:5007:6261:6653:10004:10400:11026:11232:11473:11657:11658:11914:12043:12296:12297:12521:12555:12895:13069:13311:13357:14181:14394:14721:21080:21451:21627:30034:30054:30056:30064:30070,0,RBL:216.228.121.143:@nvidia.com:.lbl8.mailshell.net-62.22.0.100 64.201.201.201;04y8abnyjwuxyby8ajseamiwr8wziopxrqzeppffnxpk3xb355acgbrc3ofdw9j.f9qjiec1ibx73pw6cu5bumhrobpyfzaf1e53p7ghsfnf38ixaaa1rdzbgsj5gqb.h-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: hope86_331646c271a8 X-Filterd-Recvd-Size: 3185 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Sat, 3 Oct 2020 01:17:25 +0000 (UTC) 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 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== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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/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)))