From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
linux-mm@kvack.org, David Hildenbrand <david@redhat.com>
Subject: [PATCH v3 00/15] Allocate and free frozen pages
Date: Mon, 25 Nov 2024 21:01:32 +0000 [thread overview]
Message-ID: <20241125210149.2976098-1-willy@infradead.org> (raw)
Slab does not need to use the page refcount at all, and it can avoid
an atomic operation on page free. Hugetlb wants to delay setting the
refcount until it has assembled a complete gigantic page. We already
have the ability to freeze a page (safely reduce its reference count to
0), so this patchset adds APIs to allocate and free pages which are in
a frozen state.
This patchset is also a step towards the Glorious Future in which struct
page doesn't have a refcount; the users which need a refcount will have
one in their per-allocation memdesc.
v3:
- Rebase to next-20241114
- Drop patch for free_the_page() as it no longer exists; instead rename
free_unref_page() to free_frozen_pages()
- Add patch to make alloc_pages_mpol() static
- Drop slab patch since slab is gone
- There are now many more callers of post_alloc_hook() and prep_new_page()
than there used to be, but I reviewed the changes and believe they are
all changed in the appropriate commit.
- Adapt to _noprof
v2: https://lore.kernel.org/linux-mm/20220809171854.3725722-1-willy@infradead.org/
Matthew Wilcox (Oracle) (15):
mm/page_alloc: Cache page_zone() result in free_unref_page()
mm: Make alloc_pages_mpol() static
mm/page_alloc: Export free_frozen_pages() instead of free_unref_page()
mm/page_alloc: Move set_page_refcounted() to callers of
post_alloc_hook()
mm/page_alloc: Move set_page_refcounted() to callers of
prep_new_page()
mm/page_alloc: Move set_page_refcounted() to callers of
get_page_from_freelist()
mm/page_alloc: Move set_page_refcounted() to callers of
__alloc_pages_cpuset_fallback()
mm/page_alloc: Move set_page_refcounted() to callers of
__alloc_pages_may_oom()
mm/page_alloc: Move set_page_refcounted() to callers of
__alloc_pages_direct_compact()
mm/page_alloc: Move set_page_refcounted() to callers of
__alloc_pages_direct_reclaim()
mm/page_alloc: Move set_page_refcounted() to callers of
__alloc_pages_slowpath()
mm/page_alloc: Move set_page_refcounted() to end of __alloc_pages()
mm/page_alloc: Add __alloc_frozen_pages()
mm/mempolicy: Add alloc_frozen_pages()
slab: Allocate frozen pages
include/linux/gfp.h | 8 -------
mm/compaction.c | 2 ++
mm/internal.h | 21 +++++++++++++++---
mm/mempolicy.c | 53 ++++++++++++++++++++++++++++----------------
mm/page_alloc.c | 45 ++++++++++++++++++++++++-------------
mm/page_frag_cache.c | 6 ++---
mm/slub.c | 6 ++---
mm/swap.c | 2 +-
8 files changed, 90 insertions(+), 53 deletions(-)
--
2.45.2
next reply other threads:[~2024-11-25 22:38 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 21:01 Matthew Wilcox (Oracle) [this message]
2024-11-25 21:01 ` [PATCH v3 01/15] mm/page_alloc: Cache page_zone() result in free_unref_page() Matthew Wilcox (Oracle)
2024-11-29 14:30 ` David Hildenbrand
2024-11-29 15:37 ` Zi Yan
2024-12-03 16:53 ` Vlastimil Babka
2024-12-03 16:54 ` Vlastimil Babka
2024-12-03 17:20 ` Matthew Wilcox
2024-12-03 18:38 ` Konstantin Ryabitsev
2024-11-25 21:01 ` [PATCH v3 02/15] mm: Make alloc_pages_mpol() static Matthew Wilcox (Oracle)
2024-11-29 14:31 ` David Hildenbrand
2024-11-29 15:42 ` Zi Yan
2024-12-03 16:58 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 03/15] mm/page_alloc: Export free_frozen_pages() instead of free_unref_page() Matthew Wilcox (Oracle)
2024-11-29 15:47 ` Zi Yan
2024-12-04 9:37 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 04/15] mm/page_alloc: Move set_page_refcounted() to callers of post_alloc_hook() Matthew Wilcox (Oracle)
2024-11-29 14:31 ` David Hildenbrand
2024-11-29 15:51 ` Zi Yan
2024-12-04 9:46 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 05/15] mm/page_alloc: Move set_page_refcounted() to callers of prep_new_page() Matthew Wilcox (Oracle)
2024-11-29 14:34 ` David Hildenbrand
2024-11-29 15:52 ` Zi Yan
2024-12-04 9:55 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 06/15] mm/page_alloc: Move set_page_refcounted() to callers of get_page_from_freelist() Matthew Wilcox (Oracle)
2024-11-29 15:55 ` Zi Yan
2024-12-04 10:03 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 07/15] mm/page_alloc: Move set_page_refcounted() to callers of __alloc_pages_cpuset_fallback() Matthew Wilcox (Oracle)
2024-11-29 15:58 ` Zi Yan
2024-12-04 10:36 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 08/15] mm/page_alloc: Move set_page_refcounted() to callers of __alloc_pages_may_oom() Matthew Wilcox (Oracle)
2024-11-29 16:01 ` Zi Yan
2024-12-04 10:37 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 09/15] mm/page_alloc: Move set_page_refcounted() to callers of __alloc_pages_direct_compact() Matthew Wilcox (Oracle)
2024-11-29 16:06 ` Zi Yan
2024-12-04 10:39 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 10/15] mm/page_alloc: Move set_page_refcounted() to callers of __alloc_pages_direct_reclaim() Matthew Wilcox (Oracle)
2024-11-29 16:08 ` Zi Yan
2024-12-04 10:41 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 11/15] mm/page_alloc: Move set_page_refcounted() to callers of __alloc_pages_slowpath() Matthew Wilcox (Oracle)
2024-11-29 16:10 ` Zi Yan
2024-12-04 10:57 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 12/15] mm/page_alloc: Move set_page_refcounted() to end of __alloc_pages() Matthew Wilcox (Oracle)
2024-11-29 16:14 ` Zi Yan
2024-12-04 11:03 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 13/15] mm/page_alloc: Add __alloc_frozen_pages() Matthew Wilcox (Oracle)
2024-11-29 14:36 ` David Hildenbrand
2024-11-29 16:19 ` Zi Yan
2024-12-04 11:10 ` Vlastimil Babka
2025-01-13 3:29 ` Andrew Morton
2024-11-25 21:01 ` [PATCH v3 14/15] mm/mempolicy: Add alloc_frozen_pages() Matthew Wilcox (Oracle)
2024-11-29 14:44 ` David Hildenbrand
2024-11-29 16:29 ` Zi Yan
2024-11-29 17:18 ` David Hildenbrand
2024-12-04 11:34 ` Vlastimil Babka
2024-12-04 13:58 ` David Hildenbrand
2024-12-04 11:29 ` Vlastimil Babka
2024-11-25 21:01 ` [PATCH v3 15/15] slab: Allocate frozen pages Matthew Wilcox (Oracle)
2024-11-27 15:07 ` David Hildenbrand
2024-11-27 15:52 ` Matthew Wilcox
2024-12-04 14:43 ` Vlastimil Babka
2025-01-13 9:18 ` Vlastimil Babka
2024-11-26 5:04 ` [PATCH v3 00/15] Allocate and free " Hyeonggon Yoo
2024-12-04 16:07 ` Vlastimil Babka
2024-12-09 0:17 ` Hyeonggon Yoo
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=20241125210149.2976098-1-willy@infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-mm@kvack.org \
/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