From patchwork Tue Sep 29 21:27:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 11806977 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 EE369618 for ; Tue, 29 Sep 2020 21:27:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 819D2207F7 for ; Tue, 29 Sep 2020 21:27:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="RU/PXkju" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 819D2207F7 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 489DA6B005C; Tue, 29 Sep 2020 17:27:52 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 43B916B0062; Tue, 29 Sep 2020 17:27:52 -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 329E06B0068; Tue, 29 Sep 2020 17:27:52 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0230.hostedemail.com [216.40.44.230]) by kanga.kvack.org (Postfix) with ESMTP id 1C37C6B005C for ; Tue, 29 Sep 2020 17:27:52 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C85E2181AE864 for ; Tue, 29 Sep 2020 21:27:51 +0000 (UTC) X-FDA: 77317386342.08.ship53_4a13ca22718d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id B16531819E769 for ; Tue, 29 Sep 2020 21:27:51 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,jhubbard@nvidia.com,,RULES_HIT:30012:30034:30054:30056:30064:30070:30074,0,RBL:216.228.121.64:@nvidia.com:.lbl8.mailshell.net-64.10.201.10 62.18.0.100;04yr3ebqfacy9uuzobfabpbj6tz4qycw7k9gemxgm68kxayuhp7fxxfsxm3kpdj.kwqakg9ogyhkqiys4i7rwukayp15y8zbf6ri437pototsumuapqtyq6mmgaccfu.o-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:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: ship53_4a13ca22718d X-Filterd-Recvd-Size: 5845 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Tue, 29 Sep 2020 21:27:50 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 29 Sep 2020 14:26:59 -0700 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 29 Sep 2020 21:27:49 +0000 Received: from sandstorm.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.10) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Tue, 29 Sep 2020 21:27:49 +0000 From: John Hubbard To: Andrew Morton CC: Jonathan Corbet , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Ralph Campbell , Shuah Khan , LKML , , , , , John Hubbard Subject: [PATCH v2 0/8] selftests/vm: gup_test, hmm-tests, assorted improvements Date: Tue, 29 Sep 2020 14:27:39 -0700 Message-ID: <20200929212747.251804-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=1601414819; bh=/l55YVIR3fkE3PZPlEjt0CYapKtFEJLwUJsGE013vto=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:MIME-Version: X-NVConfidentiality:Content-Transfer-Encoding:Content-Type; b=RU/PXkjuWn/si5ipW7kToDDoAWVz3SWhgMkGRcvK6CYj0+Q12iG3mpq42k21n7319 TxaR8Ug/il5JP1RXORhiuWRMxg4vKY0ECaTVpnw0E+7fCkJv+F3fG3uE8bryzAzYdi ClAJrq2do5e4LarQN8OvqDypPVgACA1o8CH6kEQlbdOPQzB2kgl36nhPcwd3MGzGPp tY1kXS0jcCo6fWsJ7WhS5yuMqJIkpJujtx1WAHNepeh1Vg/b+yRB+3PRIo4LKsKKpb rwaTs62LouCSUJQw5fVXjLOFyvvs4JTzMfiUutXauF60GOXqjew7ANbiUoDyabk/Ja bjsiCZXrKp1Sg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Changes since v1: * check_config.sh now invokes the compiler via the Makefile's ($CC), thanks to Jason Gunthorpe for calling that out. * Removed a misleading sentence from patch #6, as identified by Ira Weiny. * Removed a forward-looking sentence, about using -lpthread in gup_test.c soon, from the commit message in patch #4, since I'm not yet sure if my local pthread-based stress tests are actually worthwhile or not. Original cover letter, still accurate at this point: This is based on the latest mmotm. Summary: This series provides two main things, and a number of smaller supporting goodies. The two main points are: 1) Add a new sub-test to gup_test, which in turn is a renamed version of gup_benchmark. This sub-test allows nicer testing of dump_pages(), at least on user-space pages. For quite a while, I was doing a quick hack to gup_test.c whenever I wanted to try out changes to dump_page(). Then Matthew Wilcox asked me what I meant when I said "I used my dump_page() unit test", and I realized that it might be nice to check in a polished up version of that. Details about how it works and how to use it are in the commit description for patch #6. 2) Fixes a limitation of hmm-tests: these tests are incredibly useful, but only if people actually build and run them. And it turns out that libhugetlbfs is a little too effective at throwing a wrench in the works, there. So I've added a little configuration check that removes just two of the 21 hmm-tests, if libhugetlbfs is not available. Further details in the commit description of patch #8. Other smaller things that this series does: a) Remove code duplication by creating gup_test.h. b) Clear up the sub-test organization, and their invocation within run_vmtests.sh. c) Other minor assorted improvements. John Hubbard (8): mm/gup_benchmark: rename to mm/gup_test selftests/vm: use a common gup_test.h selftests/vm: rename run_vmtests --> run_vmtests.sh selftests/vm: minor cleanup: Makefile and gup_test.c selftests/vm: only some gup_test items are really benchmarks selftests/vm: gup_test: introduce the dump_pages() sub-test selftests/vm: run_vmtest.sh: update and clean up gup_test invocation selftests/vm: hmm-tests: remove the libhugetlbfs dependency Documentation/core-api/pin_user_pages.rst | 6 +- arch/s390/configs/debug_defconfig | 2 +- arch/s390/configs/defconfig | 2 +- mm/Kconfig | 21 +- mm/Makefile | 2 +- mm/{gup_benchmark.c => gup_test.c} | 109 ++++++---- mm/gup_test.h | 32 +++ tools/testing/selftests/vm/.gitignore | 3 +- tools/testing/selftests/vm/Makefile | 38 +++- tools/testing/selftests/vm/check_config.sh | 31 +++ tools/testing/selftests/vm/config | 2 +- tools/testing/selftests/vm/gup_benchmark.c | 137 ------------- tools/testing/selftests/vm/gup_test.c | 188 ++++++++++++++++++ tools/testing/selftests/vm/hmm-tests.c | 10 +- .../vm/{run_vmtests => run_vmtest.sh} | 24 ++- 15 files changed, 404 insertions(+), 203 deletions(-) rename mm/{gup_benchmark.c => gup_test.c} (59%) create mode 100644 mm/gup_test.h create mode 100755 tools/testing/selftests/vm/check_config.sh delete mode 100644 tools/testing/selftests/vm/gup_benchmark.c create mode 100644 tools/testing/selftests/vm/gup_test.c rename tools/testing/selftests/vm/{run_vmtests => run_vmtest.sh} (91%)