From patchwork Tue Mar 24 01:14:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 11454367 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 E5740139A for ; Tue, 24 Mar 2020 01:15:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AA1B520735 for ; Tue, 24 Mar 2020 01:15:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="iHwqZjCG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA1B520735 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D46C86B0006; Mon, 23 Mar 2020 21:15:12 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CF6E56B006E; Mon, 23 Mar 2020 21:15:12 -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 C0D6C6B0071; Mon, 23 Mar 2020 21:15:12 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id AB2D76B0006 for ; Mon, 23 Mar 2020 21:15:12 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 721421859E339 for ; Tue, 24 Mar 2020 01:15:12 +0000 (UTC) X-FDA: 76628487264.25.pain92_4a83a6a68c04d X-Spam-Summary: 2,0,0,65ce0026b0e1c549,d41d8cd98f00b204,jgg@ziepe.ca,,RULES_HIT:41:69:355:379:541:800:960:967:968:973:988:989:1260:1311:1314:1345:1437:1515:1535:1542:1711:1730:1747:1777:1792:1801:2393:2525:2559:2563:2682:2685:2859:2895:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:5007:6117:6119:6120:6261:6653:7576:7875:7901:7903:9025:10004:11026:11232:11473:11657:11658:11914:12043:12297:12438:12517:12519:12555:12679:12895:12986:13095:13846:13894:14096:14181:14394:14721:21080:21325:21433:21444:21451:21627:21740:21990:30012:30054:30056:30070,0,RBL:209.85.219.65:@ziepe.ca:.lbl8.mailshell.net-66.100.201.201 62.2.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:47,LUA_SUMMARY:none X-HE-Tag: pain92_4a83a6a68c04d X-Filterd-Recvd-Size: 5161 Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Tue, 24 Mar 2020 01:15:11 +0000 (UTC) Received: by mail-qv1-f65.google.com with SMTP id ca9so8416573qvb.9 for ; Mon, 23 Mar 2020 18:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rP5gDKTxRal88aL3AV5WtEMvRZc38NV86zzyK+lBqtQ=; b=iHwqZjCG+OlxOBwnmkPYZ3sfKTn7/buiXu1Mt4UrscwhHTg5T+vSBVrp6VvL6GsEXI jlOOWXICOV8dJ7mZVSH/3bAA0i+ACyfu1M49RlXImE0q0oAJ/iZV61OUweUStr2SgdP8 NLTOYRwny9se+Bdewa4DkcNvFPl7m4IVrzMTGixJZUJbAGZBHdY+0tKkMF1GhqTZ2yCz wasdcGCRCN4fzlclH2qkf5PSYwVbxh6sITVDrK02pEpGEf3WO7uqxRjoodOLlZo3Nz5h RFj3T2i/VsWNddYwwE/hPRb6lGkyijZY9Rib+oVPAfINSNbvbogrCngKYJ6VXKCsIQ1I 9QhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rP5gDKTxRal88aL3AV5WtEMvRZc38NV86zzyK+lBqtQ=; b=DNJAKiBzJtTrP1BWaaylXGl+dJr5E8Yt2WAMJGeqwVW/6T/l3nw3gfj/wHB3slh84N PltaSCtPMGuTvS86q5Xv/2bazjNDbDtZ0bypOLI7x/vwVerm9NiXeaddjN5pt2yJaZ7I rA2mqMo2rl1QeRZZ8qrqaw2Mf0Sbs6vA68HiWKPHiUxleDeM2agLLV0NbNtx6jVETYfE obUdf6r7gMm++OJdG9WfIq6/XlqX66Dai/n0grYOXic6e4RBVNv7v2Tjigzl/fD1GxZo p64TAlS21DobsCHa+KcJQ5cGp98ZivnfuU7c+qnOJVn+0qbXpnE+UB52Swz2eoTp9Qiz RtJA== X-Gm-Message-State: ANhLgQ2CbhQfTqaq+nJJ2TpY+8MGKU5OvQU1H/6yUaDw/kzU64PUP65p j/gkyHCvmF5/Bk8MFzqt1IL/Ew== X-Google-Smtp-Source: ADFU+vtzOvVz5k63PI5BvDBeCC1EMUBt/jXcl7iD590LuqeDvie5OF/CVQLPkNI/ifw73K/0TaLfZg== X-Received: by 2002:ad4:45ae:: with SMTP id y14mr1552691qvu.119.1585012511322; Mon, 23 Mar 2020 18:15:11 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id j50sm13712706qta.42.2020.03.23.18.15.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Mar 2020 18:15:10 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1jGY9t-0000qi-WD; Mon, 23 Mar 2020 22:15:10 -0300 From: Jason Gunthorpe To: Jerome Glisse , Ralph Campbell , Felix.Kuehling@amd.com Cc: linux-mm@kvack.org, John Hubbard , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Christoph Hellwig , Philip Yang , Jason Gunthorpe Subject: [PATCH v2 hmm 0/9] Small hmm_range_fault() cleanups Date: Mon, 23 Mar 2020 22:14:48 -0300 Message-Id: <20200324011457.2817-1-jgg@ziepe.ca> X-Mailer: git-send-email 2.25.2 MIME-Version: 1.0 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: From: Jason Gunthorpe This is v2 of the first simple series with a few additional patches of little adjustments. This needs an additional patch to the hmm tester: v2 changes: - Simplify and rename the flags, rework hmm_vma_walk_test in patch 2 (CH) - Adjust more comments in patch 3 (CH, Ralph) - Put the ugly boolean logic into a function in patch 3 (CH) - Update commit message of patch 4 (CH) - Adjust formatting in patch 5 (CH) Patches 6, 7, 8 are new v1: https://lore.kernel.org/r/20200320164905.21722-1-jgg@ziepe.ca Jason Gunthorpe (9): mm/hmm: remove pgmap checking for devmap pages mm/hmm: return the fault type from hmm_pte_need_fault() mm/hmm: remove unused code and tidy comments mm/hmm: remove HMM_FAULT_SNAPSHOT mm/hmm: remove the CONFIG_TRANSPARENT_HUGEPAGE #ifdef mm/hmm: use device_private_entry_to_pfn() mm/hmm: do not unconditionally set pfns when returning EBUSY mm/hmm: do not set pfns when returning an error code mm/hmm: return error for non-vma snapshots Documentation/vm/hmm.rst | 12 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- drivers/gpu/drm/nouveau/nouveau_svm.c | 2 +- include/linux/hmm.h | 109 +-------- mm/hmm.c | 312 ++++++++++-------------- 5 files changed, 133 insertions(+), 304 deletions(-) Tested-by: Ralph Campbell diff --git a/tools/testing/selftests/vm/hmm-tests.c b/tools/testing/selftests/vm/hmm-tests.c index 033a12c7ab5b6d..da15471a2bbf9a 100644 --- a/tools/testing/selftests/vm/hmm-tests.c +++ b/tools/testing/selftests/vm/hmm-tests.c @@ -1274,7 +1274,7 @@ TEST_F(hmm2, snapshot) /* Check what the device saw. */ m = buffer->mirror; ASSERT_EQ(m[0], HMM_DMIRROR_PROT_ERROR); - ASSERT_EQ(m[1], HMM_DMIRROR_PROT_NONE); + ASSERT_EQ(m[1], HMM_DMIRROR_PROT_ERROR); ASSERT_EQ(m[2], HMM_DMIRROR_PROT_ZERO | HMM_DMIRROR_PROT_READ); ASSERT_EQ(m[3], HMM_DMIRROR_PROT_READ); ASSERT_EQ(m[4], HMM_DMIRROR_PROT_WRITE);