From patchwork Wed Apr 22 19:50:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralph Campbell X-Patchwork-Id: 11504423 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 7CDAD159A for ; Wed, 22 Apr 2020 19:50:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4A2D320882 for ; Wed, 22 Apr 2020 19:50:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="CrwTNWk1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A2D320882 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 352298E0006; Wed, 22 Apr 2020 15:50:48 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 301718E0005; Wed, 22 Apr 2020 15:50:48 -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 217618E0006; Wed, 22 Apr 2020 15:50:48 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 019128E0003 for ; Wed, 22 Apr 2020 15:50:47 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id AE66F181AC9CC for ; Wed, 22 Apr 2020 19:50:47 +0000 (UTC) X-FDA: 76736533734.24.rub76_6dedaa38ac0b X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,rcampbell@nvidia.com,,RULES_HIT:30034: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:24,LUA_SUMMARY:none X-HE-Tag: rub76_6dedaa38ac0b X-Filterd-Recvd-Size: 5031 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Wed, 22 Apr 2020 19:50:46 +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 ; Wed, 22 Apr 2020 12:48:49 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 22 Apr 2020 12:50:45 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 22 Apr 2020 12:50:45 -0700 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; Wed, 22 Apr 2020 19:50:42 +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; Wed, 22 Apr 2020 19:50:42 +0000 Received: from rcampbell-dev.nvidia.com (Not Verified[10.110.48.66]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Wed, 22 Apr 2020 12:50:41 -0700 From: Ralph Campbell To: , , , CC: Jerome Glisse , John Hubbard , Christoph Hellwig , Jason Gunthorpe , "Andrew Morton" , Shuah Khan , "Ralph Campbell" Subject: [PATCH v10 0/3] mm/hmm/test: add self tests for HMM Date: Wed, 22 Apr 2020 12:50:25 -0700 Message-ID: <20200422195028.3684-1-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1587584929; bh=tQslaTxOwr/1HMEaEgJ5onqwCDIFWBtI9FSraeL17vE=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding; b=CrwTNWk1dZywtqSd01Bo2vOEtMf3n/uUsh1ixYuiEWppZn3keB2tB/VQEPVoUpA5v KUiXQn4GrXWDydsaGiakqTXFIIoR+jp9aj3tyBGUT39mQux/CC03+C8USTw0WXK2zY 0O9AFfNlnRhW4VOHPfDPCTvSeinFEsGuWcQA/xDx4wLV+leIcTi4GoGAadIovezCoA wH03q0sJCUwewqvItWB6VXXm7AbtlIFXeOqzK7rfbwKYNeXsys1/tJnw2mBAbc5zbK q6LxnN787j7EB2NVneac6uy4bdiKvzTGXkTgDXOCIP9yoqtArI6305jqhyqdI8O7O0 J39dQuuPpNAfg== 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 are intended for Jason Gunthorpe's rdma tree since he is making some HMM related changes that this can help test. Changes v9 -> v10: Patches 1 & 2 include Jason's changes from his cover letter: https://lkml.org/lkml/2020/4/21/1320 Patch 3 now adds the files alphbetically and removed the outdated reference to include/uapi/linux. Changes v8 -> v9: Rebased to linux-5.7.0-rc1. Moved include/uapi/linux/test_hmm.h to lib/test_hmm_uapi.h Added calls to release_mem_region() to free device private addresses Applied Jason's suggested changes for v8. Added a check for no VMA read access before migrating to device private memory. Changes v7 -> v8: Rebased to Jason's rdma/hmm tree, plus Jason's 6 patch series "Small hmm_range_fault() cleanups". Applied a number of changes from Jason's comments. Changes v6 -> v7: Rebased to linux-5.6.0-rc6 Reverted back to just using mmu_interval_notifier_insert() and making this series only introduce HMM self tests. Changes v5 -> v6: Rebased to linux-5.5.0-rc6 Refactored mmu interval notifier patches Converted nouveau to use the new mmu interval notifier API Changes v4 -> v5: Added mmu interval notifier insert/remove/update callable from the invalidate() callback Updated HMM tests to use the new core interval notifier API Changes v1 -> v4: https://lore.kernel.org/linux-mm/20191104222141.5173-1-rcampbell@nvidia.com Ralph Campbell (3): mm/hmm/test: add selftest driver for HMM mm/hmm/test: add selftests for HMM MAINTAINERS: add HMM selftests MAINTAINERS | 2 + lib/Kconfig.debug | 13 + lib/Makefile | 1 + lib/test_hmm.c | 1149 ++++++++++++++++++++ lib/test_hmm_uapi.h | 59 + 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 | 1359 ++++++++++++++++++++++++ tools/testing/selftests/vm/run_vmtests | 16 + tools/testing/selftests/vm/test_hmm.sh | 97 ++ 11 files changed, 2702 insertions(+) create mode 100644 lib/test_hmm.c create mode 100644 lib/test_hmm_uapi.h create mode 100644 tools/testing/selftests/vm/hmm-tests.c create mode 100755 tools/testing/selftests/vm/test_hmm.sh