Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp134268ybv; Thu, 6 Feb 2020 19:38:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzGIt0DgrQc2o4eIuteqoWw4ef55Dw1C7Pe29iq1i+zsesPIg6I1Aerqbi8pb5J7yRHXgEw X-Received: by 2002:a9d:7c99:: with SMTP id q25mr1119342otn.105.1581046737437; Thu, 06 Feb 2020 19:38:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581046737; cv=none; d=google.com; s=arc-20160816; b=m0T0IjssMfZ87RzLTVDL/zsmgVz+6BKerfnLw4FKn3SbTY1d1q1qyOM2VwPTWBi8l5 k2HU0cZy4xTPVBc5s/w59x5oK9xjpLibIftVucZex+W2UwIBhxZEZZUpPa6RynNsMoq6 +mEiHjhim3sqlnP9ALy4cSIoK3SXX+NsGRhh4bYJJvteVInTAdH/DatuzVW8Nv2vUNrP rr/iqenZEXXUp69kNTY4I+wxuuiTvwgnP0QFr/H0eMQ88Og6EpQzs2gj0StRr4mHSufW r61mPiUmJFpsbyjvKkmTX3NmZ3T1nojAX/R/kAwBzuXwGqq1OGv8TYuoCMXmYHr+L4fY eP2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=Q/jtf1QAQWUBdGa6x5cGwrQgIxtlzXz53YFDTgazJkU=; b=PyZ+qtkeBs20BQF0yI3D7HjeLVlFh3anXMABOYrd+/xnIzTFIsf2RblKztUNFQyNza 2KhkiKMCGleb0owXgARU6MfzLxpFt57F8h/uGHq+yUrTTNBarpBs7t8JHEScTZfz/JOS D+aXbvj/NfxxIKy2I5LrfQ7VL6myOa6sIW+hLfWAiblpn/uUS5qJO4P1UCausNbnglde 3WBnY2OBzqpLVcfQlBPlSLQ4DU/aDq1jqRRf7c3blJIKNTwGl99x9o4GIlPTmia8+GOR t66WHfvTXUX4TZeaw5IJ1B4MggiGpklk4kSX+uHSioVUgbY43jL3cn4joJyKqCbBGMkO Ed+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=Fup0b6Kv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id v7si2723454oic.208.2020.02.06.19.38.45; Thu, 06 Feb 2020 19:38:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=Fup0b6Kv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727649AbgBGDho (ORCPT + 99 others); Thu, 6 Feb 2020 22:37:44 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:4758 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727507AbgBGDhj (ORCPT ); Thu, 6 Feb 2020 22:37:39 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 06 Feb 2020 19:36:39 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 06 Feb 2020 19:37:38 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 06 Feb 2020 19:37:38 -0800 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 7 Feb 2020 03:37:37 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 7 Feb 2020 03:37:37 +0000 Received: from blueforge.nvidia.com (Not Verified[10.110.48.28]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Thu, 06 Feb 2020 19:37:37 -0800 From: John Hubbard To: Andrew Morton CC: Al Viro , Christoph Hellwig , Dan Williams , Dave Chinner , Ira Weiny , Jan Kara , Jason Gunthorpe , Jonathan Corbet , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , "Kirill A . Shutemov" , Michal Hocko , Mike Kravetz , Shuah Khan , Vlastimil Babka , Matthew Wilcox , , , , , , LKML , John Hubbard Subject: [PATCH v5 12/12] selftests/vm: run_vmtests: invoke gup_benchmark with basic FOLL_PIN coverage Date: Thu, 6 Feb 2020 19:37:35 -0800 Message-ID: <20200207033735.308000-13-jhubbard@nvidia.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200207033735.308000-1-jhubbard@nvidia.com> References: <20200207033735.308000-1-jhubbard@nvidia.com> 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=1581046599; bh=Q/jtf1QAQWUBdGa6x5cGwrQgIxtlzXz53YFDTgazJkU=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:X-NVConfidentiality: Content-Transfer-Encoding:Content-Type; b=Fup0b6Kv4uhgXzCOkS/+I3lNjHs8zqmG+QDr/O+t3JAozUiZkX7jTu8SqFwVvmpKM 1tJBP4sx1VPnr6pykw5sUMOJJMYIgZ6G8lf/wN2RrG31B1YtQQ555sTEAfLmOfSCpr 10oRRP5we5qaMiglfsD1ew2GHzRV+tb0SpzRsIORnkcGLcQXHpwMDmlGJRqbAeBL4K nHX4N4wCkCY/lAaghUjh3OqUECR80opukaMJyk3WfQj+Qav3SfTwiloLXVPxERyaUm nmB8H+Cj6enSdkVE+NBbWCai4bKBQNXfN7bPjIh4TaPb6bfJ44+e7ZT3oRhXQaBNZe 9PmoL0ieTesJQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's good to have basic unit test coverage of the new FOLL_PIN behavior. Fortunately, the gup_benchmark unit test is extremely fast (a few milliseconds), so adding it the the run_vmtests suite is going to cause no noticeable change in running time. So, add two new invocations to run_vmtests: 1) Run gup_benchmark with normal get_user_pages(). 2) Run gup_benchmark with pin_user_pages(). This is much like the first call, except that it sets FOLL_PIN. Running these two in quick succession also provide a visual comparison of the running times, which is convenient. The new invocations are fairly early in the run_vmtests script, because with test suites, it's usually preferable to put the shorter, faster tests first, all other things being equal. Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- tools/testing/selftests/vm/run_vmtests | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/testing/selftests/vm/run_vmtests b/tools/testing/selftes= ts/vm/run_vmtests index a692ea828317..df6a6bf3f238 100755 --- a/tools/testing/selftests/vm/run_vmtests +++ b/tools/testing/selftests/vm/run_vmtests @@ -112,6 +112,28 @@ echo "NOTE: The above hugetlb tests provide minimal co= verage. Use" echo " https://github.com/libhugetlbfs/libhugetlbfs.git for" echo " hugetlb regression testing." =20 +echo "--------------------------------------------" +echo "running 'gup_benchmark -U' (normal/slow gup)" +echo "--------------------------------------------" +./gup_benchmark -U +if [ $? -ne 0 ]; then + echo "[FAIL]" + exitcode=3D1 +else + echo "[PASS]" +fi + +echo "------------------------------------------" +echo "running gup_benchmark -b (pin_user_pages)" +echo "------------------------------------------" +./gup_benchmark -b +if [ $? -ne 0 ]; then + echo "[FAIL]" + exitcode=3D1 +else + echo "[PASS]" +fi + echo "-------------------" echo "running userfaultfd" echo "-------------------" --=20 2.25.0