From patchwork Mon Dec 16 19:57:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralph Campbell X-Patchwork-Id: 11295107 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 5C0FA17F0 for ; Mon, 16 Dec 2019 19:57:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 27BA921582 for ; Mon, 16 Dec 2019 19:57:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="NkfeIT/C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27BA921582 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 2609A8E0015; Mon, 16 Dec 2019 14:57:53 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 210D68E0003; Mon, 16 Dec 2019 14:57:53 -0500 (EST) 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 0D83D8E0015; Mon, 16 Dec 2019 14:57:53 -0500 (EST) 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 E9CED8E0003 for ; Mon, 16 Dec 2019 14:57:52 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 98D5C180AD804 for ; Mon, 16 Dec 2019 19:57:52 +0000 (UTC) X-FDA: 76272065184.27.quiet89_276de7496db10 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,rcampbell@nvidia.com,:linux-rdma@vger.kernel.org::linux-kernel@vger.kernel.org:linux-kselftest@vger.kernel.org:jglisse@redhat.com:jhubbard@nvidia.com:hch@lst.de:jgg@mellanox.com:akpm@linux-foundation.org:shuah@kernel.org:rcampbell@nvidia.com,RULES_HIT:30003:30054:30056:30064:30070,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:61,LUA_SUMMARY:none X-HE-Tag: quiet89_276de7496db10 X-Filterd-Recvd-Size: 4409 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Dec 2019 19:57:50 +0000 (UTC) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 16 Dec 2019 11:57:22 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 16 Dec 2019 11:57:49 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 16 Dec 2019 11:57:49 -0800 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 16 Dec 2019 19:57:47 +0000 Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 16 Dec 2019 19:57:46 +0000 Received: from rcampbell-dev.nvidia.com (Not Verified[10.110.48.66]) by rnnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Mon, 16 Dec 2019 11:57:46 -0800 From: Ralph Campbell To: , , , CC: Jerome Glisse , John Hubbard , Christoph Hellwig , Jason Gunthorpe , "Andrew Morton" , Shuah Khan , "Ralph Campbell" Subject: [PATCH v5 0/2] mm/hmm/test: add self tests for HMM Date: Mon, 16 Dec 2019 11:57:31 -0800 Message-ID: <20191216195733.28353-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=1576526242; bh=c+0LXJAAa4iRvvJNP9qW63zka2XWJ3Ad+NBLnq3STuE=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:X-NVConfidentiality:Content-Type: Content-Transfer-Encoding; b=NkfeIT/CqWvjl9YCstxoAo/Cp2YpQXzJ6AmaYmvVM/lGETvUvAMSy8JPXNMsFbPYv BtUoyxmNG62NEOngT+mnmbWQr7hXpVOE3eC9otPZXDY9UgQm6vhuwNH71XneyqYWwN 3g38pUhvIUCRmKkTDMNxf3EJ1tYmFdSrVQCUripY34UC0ku28MfYOifsmESGXA4vNb lN2q9coCR+Dy9pUdxZqIq8lC5yDRu/fa1ryEBua9HSk5FZ70TrLqAogrCF2DqHKUK/ 4lu5UipdSVUQI7zSclCiO5Svep2aeby/yjwvj6vpReFgocU/+GoBrmIAswdDWU998r P+TWVIoDuosQQ== 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: This series adds basic self tests for HMM and mmu interval notifiers so that changes can be validated. It is based on linux-5.5.0-rc1 and is for Jason's rdma/hmm tree since I believe he is planning some interval notifier changes. Patch 2 was last posted as part of [1] but the other patches in that series have been merged and this version of the HMM tests is modified to address Jason's concern over using both process wide MMU notifiers in combination with MMU interval notifiers. Therefore, patch 1 adds some core functionality to allow intervals to be updated from within the invalidation() callback so that MMU_NOTIFY_UNMAP events can update the range being tracked. [1] https://lore.kernel.org/linux-mm/20191104222141.5173-1-rcampbell@nvidia.com Ralph Campbell (2): mm/mmu_notifier: make interval notifier updates safe mm/hmm/test: add self tests for HMM MAINTAINERS | 3 + include/linux/mmu_notifier.h | 15 + lib/Kconfig.debug | 11 + lib/Makefile | 1 + lib/test_hmm.c | 1367 ++++++++++++++++++++++++ mm/mmu_notifier.c | 196 +++- tools/testing/selftests/vm/.gitignore | 1 + tools/testing/selftests/vm/Makefile | 3 + tools/testing/selftests/vm/config | 2 + tools/testing/selftests/vm/hmm-tests.c | 1360 +++++++++++++++++++++++ tools/testing/selftests/vm/run_vmtests | 16 + tools/testing/selftests/vm/test_hmm.sh | 97 ++ 12 files changed, 3047 insertions(+), 25 deletions(-) create mode 100644 lib/test_hmm.c create mode 100644 tools/testing/selftests/vm/hmm-tests.c create mode 100755 tools/testing/selftests/vm/test_hmm.sh