From patchwork Tue Oct 15 20:48:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralph Campbell X-Patchwork-Id: 11191655 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 C0CFA13BD for ; Tue, 15 Oct 2019 20:48:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7D14320873 for ; Tue, 15 Oct 2019 20:48:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="JUfM0oRX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D14320873 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 A318F8E0006; Tue, 15 Oct 2019 16:48:29 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A08B08E0001; Tue, 15 Oct 2019 16:48:29 -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 883318E0006; Tue, 15 Oct 2019 16:48:29 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id 6AD198E0001 for ; Tue, 15 Oct 2019 16:48:29 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id F1B574DA3 for ; Tue, 15 Oct 2019 20:48:28 +0000 (UTC) X-FDA: 76047207096.11.tramp66_49ce5c790ff1e X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,rcampbell@nvidia.com,:jglisse@redhat.com:jhubbard@nvidia.com:hch@lst.de:jgg@mellanox.com:linux-rdma@vger.kernel.org::rcampbell@nvidia.com,RULES_HIT:30054:30056:30064,0,RBL:216.228.121.143:@nvidia.com:.lbl8.mailshell.net-62.18.0.100 64.10.201.10,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:48,LUA_SUMMARY:none X-HE-Tag: tramp66_49ce5c790ff1e X-Filterd-Recvd-Size: 4367 Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Oct 2019 20:48:26 +0000 (UTC) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 15 Oct 2019 13:48:30 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 15 Oct 2019 13:48:25 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 15 Oct 2019 13:48:25 -0700 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 15 Oct 2019 20:48:25 +0000 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, 15 Oct 2019 20:48:20 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 15 Oct 2019 20:48:20 +0000 Received: from rcampbell-dev.nvidia.com (Not Verified[10.110.48.66]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Tue, 15 Oct 2019 13:48:20 -0700 From: Ralph Campbell To: Jerome Glisse , John Hubbard , Christoph Hellwig , Jason Gunthorpe CC: , , Ralph Campbell Subject: [PATCH v2 0/3] HMM tests and minor fixes Date: Tue, 15 Oct 2019 13:48:11 -0700 Message-ID: <20191015204814.30099-1-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-NVConfidentiality: public DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1571172510; bh=rS+xTIAGRfJcOcX7xmaAy1sXD189JENoPg3WT4zZ3w8=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:X-NVConfidentiality:Content-Type: Content-Transfer-Encoding; b=JUfM0oRXJ8VmwTsQA6KDwdNIZaJidSiZmSCnw1rZ9ronfzybgAMf+04OCMtnpi7MV +2ozGnL2BM3HcJOL27YpXF4TAno8j0ND0seWl98OYz1unFEp5d9k4JZTinyhOUX2e8 V1WNlc5+uZuxiN/YroFRiNaAlnsrwzAY1ooHy55oqAas5BGpyw//Hz6Li5knxDG4HM n7h8LDD8Q3fD4wUSpwiS1/1be6Rw13gkLSg9t0GLb5teM7iCY9n9Sm4zfprGB+utsD uGkUITMXRiBpgMnll8nUryEHmdVfPfhPGN+GCVBwyHa3GY8NE4jRUJhoQoeZLTNpmr /M7B+W4tjkjPQ== 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: These changes are based on Jason's rdma/hmm branch (5.4.0-rc1). Patch 1 was previously posted here [1] but was dropped from that orginal series. Hopefully, the tests will reduce concerns about edge conditions. I'm sure more tests could be usefully added but I thought this was a good starting point. Changes since v1: Rebased to Jason's rdma/hmm branch (5.4.0-rc1). Cleaned up locking for the test driver's page tables. Incorporated Christoph Hellwig's comments. [1] https://lore.kernel.org/linux-mm/20190726005650.2566-6-rcampbell@nvidia.com/ Ralph Campbell (3): mm/hmm: make full use of walk_page_range() mm/hmm: allow snapshot of the special zero page mm/hmm/test: add self tests for HMM MAINTAINERS | 3 + drivers/char/Kconfig | 11 + drivers/char/Makefile | 1 + drivers/char/hmm_dmirror.c | 1574 ++++++++++++++++++++++++ include/Kbuild | 1 + include/uapi/linux/hmm_dmirror.h | 74 ++ mm/hmm.c | 147 ++- tools/testing/selftests/vm/.gitignore | 1 + tools/testing/selftests/vm/Makefile | 3 + tools/testing/selftests/vm/config | 3 + tools/testing/selftests/vm/hmm-tests.c | 1311 ++++++++++++++++++++ tools/testing/selftests/vm/run_vmtests | 16 + tools/testing/selftests/vm/test_hmm.sh | 97 ++ 13 files changed, 3178 insertions(+), 64 deletions(-) create mode 100644 drivers/char/hmm_dmirror.c create mode 100644 include/uapi/linux/hmm_dmirror.h create mode 100644 tools/testing/selftests/vm/hmm-tests.c create mode 100755 tools/testing/selftests/vm/test_hmm.sh