From patchwork Fri May 1 18:20:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 11523123 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 94D0B92C for ; Fri, 1 May 2020 18:20:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 61BF9216FD for ; Fri, 1 May 2020 18:20:52 +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="nEPB/kPU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61BF9216FD 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 793C38E0005; Fri, 1 May 2020 14:20:51 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7446B8E0001; Fri, 1 May 2020 14:20:51 -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 633548E0005; Fri, 1 May 2020 14:20:51 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id 466CE8E0001 for ; Fri, 1 May 2020 14:20:51 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 111F65821 for ; Fri, 1 May 2020 18:20:51 +0000 (UTC) X-FDA: 76768966302.30.band78_2476eea467c08 X-Spam-Summary: 10,1,0,824e98ad5d7ecb98,d41d8cd98f00b204,jgg@ziepe.ca,,RULES_HIT:41:69:152:355:379:800:960:966:967:968:973:988:989:1260:1277:1311:1313:1314:1321:1345:1431:1437:1515:1516:1518:1535:1542:1593:1594:1711:1730:1747:1777:1792:1801:2196:2199:2393:2525:2559:2563:2682:2685:2859: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:4385:4605:5007:6119:6120:6261:6653:6742:7576:7875:7901:7903:8660:8957:9025:9040:10004:10400:11026:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12895:13095:13148:13161:13229:13230:13846:13894:14096:14097:14181:14394:14659:14721:21080:21433:21444:21451:21627:21990:30012:30034:30054:30064,0,RBL:209.85.160.196:@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:32,LUA_SUMMARY:none X-HE-Tag: band78_2476eea467c08 X-Filterd-Recvd-Size: 5799 Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Fri, 1 May 2020 18:20:50 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id g26so4736592qtv.13 for ; Fri, 01 May 2020 11:20:50 -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=sDjIEM+eSzMwryve6HfF6tWEHpQ1YVsnKklV3y9mbGo=; b=nEPB/kPUVu64ALDJjlHG9rMKTiO65lpugPdBC30Nczov+tgzGXPn6wpmV85NOyxRh5 3llmUpX+zBdGg9ao+A8Dyp3OnqDyGBYB6vqDjCxOxw5mjJPKQo6DB/cC07qH7cSXDWlk xT4JrOhmLTygWIPY4TatqdbFhJhSZImrg17m9LM8AKb8xkfmkMFcSYAOisggYpw2tOSK s3vV/30613M9nsClks7/z1Whk4BcpdM8wHMSt0GTIsR5+hRulh2NImOiBoJFW/rg1wOH inAEReWsuS05YfwJRAyPScaLj42vxYgfD6RLvZrbk1XcHFRCd2h2j5a1KLt7/kD3PyeZ vl9A== 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=sDjIEM+eSzMwryve6HfF6tWEHpQ1YVsnKklV3y9mbGo=; b=WYHAtZaP0mWITXLuLqThFRfpIpPXFyXDBVxFoRpEjcuHbFHQTmrTG2bAIIRnSkAUBL jOZuQN1KMT0Rnx0EI0LjXgy2ce2nIcouXxLP/3KsEI6SinvyKVkCdCzRDMB7iO4ypCi8 6yN5L8HRzejXRjZZvzOr9ta2PLXRCXg4BfbsLlxG6qPw26uQNHsoIAxAMDPQ50CDxwkx MBalgGVwpywAUv2e+t6Uy0Y01AlGovDDtyh9xORuId0C2PQBGq2xk7dU5rtoKfbWD5gF 5Wyk59vVeYXgfoXnHjvQmQvjQAganbmr4koRaoZexbm1HNxHBbY1/uWSUYto9Ww0FMzk RMqg== X-Gm-Message-State: AGi0PuZD2mqABFTnM91ljYYvEWP5epAFzANE2wYIxbNpDrMNCjKCPcAa Sd5AJQmW8AP2DrJQ6IhmiHDkSt2HzFE= X-Google-Smtp-Source: APiQypLnto+0lS8NZSLIiaARckcdYZmXp5cRSri5MnUXK85RufiSt8ijYevAzNOi5g9Dq58iHtdy2g== X-Received: by 2002:ac8:3254:: with SMTP id y20mr5176017qta.67.1588357249676; Fri, 01 May 2020 11:20:49 -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 n92sm3048968qtd.68.2020.05.01.11.20.48 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 May 2020 11:20:49 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1jUaHI-0006oH-Ci; Fri, 01 May 2020 15:20:48 -0300 From: Jason Gunthorpe To: linux-mm@kvack.org, Ralph Campbell Cc: Alex Deucher , amd-gfx@lists.freedesktop.org, Ben Skeggs , =?utf-8?q?Christian_K=C3=B6nig?= , "David (ChunMing) Zhou" , dri-devel@lists.freedesktop.org, Felix Kuehling , Christoph Hellwig , intel-gfx@lists.freedesktop.org, =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , John Hubbard , linux-kernel@vger.kernel.org, Niranjana Vishwanathapura , nouveau@lists.freedesktop.org, "Yang, Philip" Subject: [PATCH hmm v2 0/5] Adjust hmm_range_fault() API Date: Fri, 1 May 2020 15:20:43 -0300 Message-Id: <0-v2-b4e84f444c7d+24f57-hmm_no_flags_jgg@mellanox.com> 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 The API is a bit complicated for the uses we actually have, and disucssions for simplifying have come up a number of times. This small series removes the customizable pfn format and simplifies the return code of hmm_range_fault() All the drivers are adjusted to process in the simplified format. I would appreciated tested-by's for the two drivers, thanks! v2: - Move call chain to commit message - Fix typo of HMM_PFN_REQ_FAULT - Move nouveau_hmm_convert_pfn() to nouveau_svm.c - Add acks and tested-bys v1: https://lore.kernel.org/r/0-v1-4eb72686de3c+5062-hmm_no_flags_jgg@mellanox.com Cc: Christoph Hellwig Cc: John Hubbard Cc: Jérôme Glisse Cc: Ben Skeggs To: Ralph Campbell Cc: nouveau@lists.freedesktop.org Cc: Niranjana Vishwanathapura Cc: intel-gfx@lists.freedesktop.org Cc: "Kuehling, Felix" Cc: Alex Deucher Cc: "Christian König" Cc: "David (ChunMing) Zhou" Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Cc: "Yang, Philip" To: linux-mm@kvack.org Jason Gunthorpe (5): mm/hmm: make CONFIG_DEVICE_PRIVATE into a select mm/hmm: make hmm_range_fault return 0 or -1 drm/amdgpu: remove dead code after hmm_range_fault() mm/hmm: remove HMM_PFN_SPECIAL mm/hmm: remove the customizable pfn format from hmm_range_fault Documentation/vm/hmm.rst | 28 ++-- arch/powerpc/Kconfig | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 56 +++---- drivers/gpu/drm/nouveau/Kconfig | 2 +- drivers/gpu/drm/nouveau/nouveau_dmem.c | 27 +--- drivers/gpu/drm/nouveau/nouveau_dmem.h | 3 +- drivers/gpu/drm/nouveau/nouveau_svm.c | 94 ++++++++---- include/linux/hmm.h | 109 +++++--------- mm/Kconfig | 7 +- mm/hmm.c | 185 +++++++++++------------- 10 files changed, 217 insertions(+), 296 deletions(-)