linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Roberts <ryan.roberts@arm.com>
To: Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Arnd Bergmann <arnd@arndb.de>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	David Hildenbrand <david@redhat.com>, Yu Zhao <yuzhao@google.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Yin Fengwei <fengwei.yin@intel.com>,
	Yang Shi <shy828301@gmail.com>,
	"Huang, Ying" <ying.huang@intel.com>, Zi Yan <ziy@nvidia.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH v1 0/4] Optimize mmap_exit for large folios
Date: Thu, 10 Aug 2023 11:33:28 +0100	[thread overview]
Message-ID: <20230810103332.3062143-1-ryan.roberts@arm.com> (raw)

Hi All,

This is a series to improve performance of process teardown, taking
advantage of the fact that large folios are increasingly regularly
pte-mapped in user space; supporting filesystems already use large
folios for pagecache memory, and large folios for anonymous memory are
(hopefully) on the horizon.

See last patch for performance numbers, including measurements that show
this approach doesn't regress (and actually improves a little bit) when
all folios are small.

The basic approach is to accumulate contiguous ranges of pages in the
mmu_gather structure (instead of storing each individual page pointer),
then take advantage of this internal format to efficiently batch rmap
removal, swapcache removal and page release - see the commit messages
for more details.

This series replaces the previous approach I took at [1], which was much
smaller in scope, only attempting to batch rmap removal for anon pages.
Feedback was that I should do something more general that would also
batch-remove pagecache pages from the rmap. But while designing that, I
found it was also possible to improve swapcache removal and page
release. Hopefully I haven't gone too far the other way now! Note that
patch 1 is unchanged from that originl series.

This series is based on mm-unstable (ad3232df3e41).

I'm going to be out on holiday from the end of today, returning on 29th
August. So responses will likely be patchy, as I'm terrified of posting
to list from my phone!

[1] https://lore.kernel.org/linux-mm/20230727141837.3386072-1-ryan.roberts@arm.com/

Thanks,
Ryan


Ryan Roberts (4):
  mm: Implement folio_remove_rmap_range()
  mm/mmu_gather: generalize mmu_gather rmap removal mechanism
  mm/mmu_gather: Remove encoded_page infrastructure
  mm/mmu_gather: Store and process pages in contig ranges

 arch/s390/include/asm/tlb.h |   9 +--
 include/asm-generic/tlb.h   |  49 +++++++-------
 include/linux/mm.h          |  11 +++-
 include/linux/mm_types.h    |  34 +---------
 include/linux/rmap.h        |   2 +
 include/linux/swap.h        |   6 +-
 mm/memory.c                 |  24 ++++---
 mm/mmu_gather.c             | 112 +++++++++++++++++++++++---------
 mm/rmap.c                   | 125 +++++++++++++++++++++++++++---------
 mm/swap.c                   |  99 ++++++++++++++++++++++++++--
 mm/swap_state.c             |  11 ++--
 11 files changed, 333 insertions(+), 149 deletions(-)

--
2.25.1



             reply	other threads:[~2023-08-10 10:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10 10:33 Ryan Roberts [this message]
2023-08-10 10:33 ` [PATCH v1 1/4] mm: Implement folio_remove_rmap_range() Ryan Roberts
2023-08-10 10:33 ` [PATCH v1 2/4] mm/mmu_gather: generalize mmu_gather rmap removal mechanism Ryan Roberts
2023-08-10 10:33 ` [PATCH v1 3/4] mm/mmu_gather: Remove encoded_page infrastructure Ryan Roberts
2023-08-10 17:34   ` Yu Zhao
2023-08-10 18:31     ` Linus Torvalds
2023-08-10 18:54       ` Ryan Roberts
2023-08-10 10:33 ` [PATCH v1 4/4] mm/mmu_gather: Store and process pages in contig ranges Ryan Roberts
2023-08-10 14:44   ` Zi Yan
2023-08-10 14:55     ` Ryan Roberts
2023-08-10 14:59       ` Zi Yan
2023-08-10 15:05         ` Ryan Roberts
2023-12-04 12:26         ` Ryan Roberts
2023-12-04 12:28           ` David Hildenbrand
2023-12-04 12:39             ` Ryan Roberts
2023-12-04 12:43               ` David Hildenbrand
2023-12-04 12:57                 ` Ryan Roberts
2023-08-25  4:09   ` Matthew Wilcox
2023-08-25  7:13     ` David Hildenbrand
2023-08-29 14:02     ` Ryan Roberts
2023-08-29 14:19       ` Matthew Wilcox
2023-08-29 14:24         ` Matthew Wilcox
2023-08-29 15:59           ` Ryan Roberts

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=20230810103332.3062143-1-ryan.roberts@arm.com \
    --to=ryan.roberts@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=arnd@arndb.de \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=fengwei.yin@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@gmail.com \
    --cc=peterz@infradead.org \
    --cc=shy828301@gmail.com \
    --cc=svens@linux.ibm.com \
    --cc=will@kernel.org \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.com \
    --cc=yuzhao@google.com \
    --cc=ziy@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