linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] mm/gup: page unpining improvements
@ 2021-02-03 22:00 Joao Martins
  2021-02-03 22:00 ` [PATCH 1/4] mm/gup: add compound page list iterator Joao Martins
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Joao Martins @ 2021-02-03 22:00 UTC (permalink / raw)
  To: linux-mm
  Cc: linux-kernel, linux-rdma, Andrew Morton, Jason Gunthorpe,
	Doug Ledford, John Hubbard, Matthew Wilcox, Joao Martins

Hey,

This series improves page unpinning, with an eye on improving MR
deregistration for big swaths of memory (which is bound by the page
unpining), particularly:

 1) Decrement the head page by @ntails and thus reducing a lot the number of
atomic operations per compound page. This is done by comparing individual
tail pages heads, and counting number of consecutive tails on which they 
match heads and based on that update head page refcount. Should have a
visible improvement in all page (un)pinners which use compound pages.

 2) Introducing a new API for unpinning page ranges (to avoid the trick in the
previous item and be based on math), and use that in RDMA ib_mem_release
(used for mr deregistration).

Performance improvements: unpin_user_pages() for hugetlbfs and THP improves ~3x
(through gup_test) and RDMA MR dereg improves ~4.5x with the new API.
See patches 2 and 4 for those.

These patches used to be in this RFC:

https://lore.kernel.org/linux-mm/20201208172901.17384-1-joao.m.martins@oracle.com/,
"[PATCH RFC 0/9] mm, sparse-vmemmap: Introduce compound pagemaps"

But were moved separately at the suggestion of Jason, given it's applicable
to page unpinning in general. Thanks for all the comments in the RFC above.

These patches apply on top of linux-next tag next-20210202.

Suggestions, comments, welcomed as usual.

	Joao

Changelog since the RFC above:

* Introduce a head/ntails iterator and change unpin_*_pages() to use that,
 inspired by folio iterators (Jason)
 Introduce an alternative unpin_user_page_range_dirty_lock() to unpin based
on a consecutive page range without having to walk page arrays (Jason)
* Use unsigned for number of tails (Jason)

Joao Martins (4):
  mm/gup: add compound page list iterator
  mm/gup: decrement head page once for group of subpages
  mm/gup: add a range variant of unpin_user_pages_dirty_lock()
  RDMA/umem: batch page unpin in __ib_mem_release()

 drivers/infiniband/core/umem.c | 12 ++---
 include/linux/mm.h             |  2 +
 mm/gup.c                       | 90 +++++++++++++++++++++++++++-------
 3 files changed, 80 insertions(+), 24 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-02-05 17:07 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 22:00 [PATCH 0/4] mm/gup: page unpining improvements Joao Martins
2021-02-03 22:00 ` [PATCH 1/4] mm/gup: add compound page list iterator Joao Martins
2021-02-03 23:00   ` John Hubbard
2021-02-04 11:27     ` Joao Martins
2021-02-04 16:09       ` Joao Martins
2021-02-04 19:53     ` Jason Gunthorpe
2021-02-04 23:37       ` John Hubbard
2021-02-03 22:00 ` [PATCH 2/4] mm/gup: decrement head page once for group of subpages Joao Martins
2021-02-03 23:28   ` John Hubbard
2021-02-04 11:27     ` Joao Martins
2021-02-03 22:00 ` [PATCH 3/4] mm/gup: add a range variant of unpin_user_pages_dirty_lock() Joao Martins
2021-02-03 23:37   ` John Hubbard
2021-02-04 11:35     ` Joao Martins
2021-02-04 16:30       ` Joao Martins
2021-02-04  0:11   ` John Hubbard
2021-02-04 11:47     ` Joao Martins
2021-02-03 22:00 ` [PATCH 4/4] RDMA/umem: batch page unpin in __ib_mem_release() Joao Martins
2021-02-04  0:15   ` John Hubbard
2021-02-04 12:29     ` Joao Martins
2021-02-04 20:00     ` Jason Gunthorpe
2021-02-05 17:00       ` Joao Martins

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).