From: Jason Gunthorpe <jgg@ziepe.ca>
To: Jerome Glisse <jglisse@redhat.com>,
Ralph Campbell <rcampbell@nvidia.com>,
Felix.Kuehling@amd.com
Cc: Philip Yang <Philip.Yang@amd.com>,
John Hubbard <jhubbard@nvidia.com>,
amd-gfx@lists.freedesktop.org, linux-mm@kvack.org,
Jason Gunthorpe <jgg@mellanox.com>,
dri-devel@lists.freedesktop.org, Christoph Hellwig <hch@lst.de>
Subject: [PATCH hmm 0/6] Small hmm_range_fault() cleanups
Date: Fri, 20 Mar 2020 13:48:59 -0300 [thread overview]
Message-ID: <20200320164905.21722-1-jgg@ziepe.ca> (raw)
From: Jason Gunthorpe <jgg@mellanox.com>
I've had these in my work queue for a bit, nothing profound here, just some
small edits for clarity.
Ralph's hmm tester will need a small diff to work after this - which
illustrates how setting default_flags == 0 is the same as what was called
SNAPSHOT:
diff --git a/lib/test_hmm.c b/lib/test_hmm.c
index 6ca953926dc13f..5f31f5b3e64cb9 100644
--- a/lib/test_hmm.c
+++ b/lib/test_hmm.c
@@ -300,7 +300,7 @@ static int dmirror_range_fault(struct dmirror *dmirror,
range->notifier_seq = mmu_interval_read_begin(range->notifier);
down_read(&mm->mmap_sem);
- count = hmm_range_fault(range, 0);
+ count = hmm_range_fault(range);
up_read(&mm->mmap_sem);
if (count <= 0) {
if (count == 0 || count == -EBUSY)
@@ -337,8 +337,7 @@ static int dmirror_fault(struct dmirror *dmirror, unsigned long start,
.flags = dmirror_hmm_flags,
.values = dmirror_hmm_values,
.pfn_shift = DPT_SHIFT,
- .pfn_flags_mask = ~(dmirror_hmm_flags[HMM_PFN_VALID] |
- dmirror_hmm_flags[HMM_PFN_WRITE]),
+ .pfn_flags_mask = 0,
.default_flags = dmirror_hmm_flags[HMM_PFN_VALID] |
(write ? dmirror_hmm_flags[HMM_PFN_WRITE] : 0),
.dev_private_owner = dmirror->mdevice,
@@ -872,7 +871,7 @@ static int dmirror_range_snapshot(struct dmirror *dmirror,
range->notifier_seq = mmu_interval_read_begin(range->notifier);
down_read(&mm->mmap_sem);
- count = hmm_range_fault(range, HMM_FAULT_SNAPSHOT);
+ count = hmm_range_fault(range);
up_read(&mm->mmap_sem);
if (count <= 0) {
if (count == 0 || count == -EBUSY)
@@ -916,7 +915,7 @@ static int dmirror_snapshot(struct dmirror *dmirror,
.flags = dmirror_hmm_flags,
.values = dmirror_hmm_values,
.pfn_shift = DPT_SHIFT,
- .pfn_flags_mask = ~0ULL,
+ .pfn_flags_mask = 0,
.dev_private_owner = dmirror->mdevice,
};
int ret = 0;
Jason Gunthorpe (6):
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()
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 | 55 +-----
mm/hmm.c | 238 +++++++++---------------
5 files changed, 98 insertions(+), 211 deletions(-)
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2020-03-21 10:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 16:48 Jason Gunthorpe [this message]
2020-03-20 16:49 ` [PATCH hmm 1/6] mm/hmm: remove pgmap checking for devmap pages Jason Gunthorpe
2020-03-20 16:49 ` [PATCH hmm 2/6] mm/hmm: return the fault type from hmm_pte_need_fault() Jason Gunthorpe
[not found] ` <20200321083726.GB28695@lst.de>
2020-03-23 20:14 ` Jason Gunthorpe
2020-03-20 16:49 ` [PATCH hmm 3/6] mm/hmm: remove unused code and tidy comments Jason Gunthorpe
2020-03-20 21:46 ` Ralph Campbell
2020-03-23 17:24 ` Jason Gunthorpe
[not found] ` <20200321083902.GC28695@lst.de>
2020-03-23 17:24 ` Jason Gunthorpe
2020-03-20 16:49 ` [PATCH hmm 4/6] mm/hmm: remove HMM_FAULT_SNAPSHOT Jason Gunthorpe
2020-03-20 16:49 ` [PATCH hmm 5/6] mm/hmm: remove the CONFIG_TRANSPARENT_HUGEPAGE #ifdef Jason Gunthorpe
[not found] ` <20200321084317.GE28695@lst.de>
2020-03-23 17:33 ` Jason Gunthorpe
2020-03-20 16:49 ` [PATCH hmm 6/6] mm/hmm: use device_private_entry_to_pfn() Jason Gunthorpe
[not found] ` <20200321084347.GF28695@lst.de>
2020-03-23 17:44 ` Jason Gunthorpe
2020-03-20 18:51 ` [PATCH hmm 0/6] Small hmm_range_fault() cleanups Ralph Campbell
2020-03-20 18:55 ` Jason Gunthorpe
2020-03-20 21:47 ` Ralph Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200320164905.21722-1-jgg@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=Felix.Kuehling@amd.com \
--cc=Philip.Yang@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hch@lst.de \
--cc=jgg@mellanox.com \
--cc=jglisse@redhat.com \
--cc=jhubbard@nvidia.com \
--cc=linux-mm@kvack.org \
--cc=rcampbell@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).