Skip to contentSkip to conversation

mm-enable-page-allocation-tagging.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Apr 26, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: enable page allocation tagging
has been removed from the -mm tree. Its filename was
mm-enable-page-allocation-tagging.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Suren Baghdasaryan <[email protected]>
Subject: mm: enable page allocation tagging
Date: Thu, 21 Mar 2024 09:36:40 -0700

Redefine page allocators to record allocation tags upon their invocation. Instrument post_alloc_hook and free_pages_prepare to modify current allocation tag.

[[email protected]: undo _noprof additions in the documentation]
Cc Alexander Viro <[email protected]>
Cc Alex Gaynor <[email protected]>
Cc Alice Ryhl <[email protected]>
Cc Andreas Hindborg <[email protected]>
Cc Benno Lossin <[email protected]>
Cc "Björn Roy Baron" <[email protected]>
Cc Boqun Feng <[email protected]>
Cc Christoph Lameter <[email protected]>
Cc Dennis Zhou <[email protected]>
Cc Gary Guo <[email protected]>
Cc Miguel Ojeda <[email protected]>
Cc Pasha Tatashin <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Wedson Almeida Filho <[email protected]>

---

 include/linux/alloc_tag.h |   14 ++++
 include/linux/gfp.h       |  126 ++++++++++++++++++++++--------------
 include/linux/pagemap.h   |    9 +-
 mm/compaction.c           |    7 +-
 mm/filemap.c              |    6 -
 mm/mempolicy.c            |   46 ++++++-------
 mm/page_alloc.c           |   52 +++++++-------
 7 files changed, 157 insertions(+), 103 deletions(-)
include/linux/alloc_tag.h renamed from include/linux/alloc_tag.h~mm-enable-page-allocation-tagging +14 -0
@@ -153,4 +153,18 @@ static inline void alloc_tag_sub(union c
 
 #endif /* CONFIG_MEM_ALLOC_PROFILING */
 
+#define alloc_hooks_tag(_tag, _do_alloc)				\
+({									\
+	struct alloc_tag * __maybe_unused _old = alloc_tag_save(_tag);	\
+	typeof(_do_alloc) _res = _do_alloc;				\
+	alloc_tag_restore(_tag, _old);					\
+	_res;								\
+})
+
+#define alloc_hooks(_do_alloc)						\
+({									\
+	DEFINE_ALLOC_TAG(_alloc_tag);					\
+	alloc_hooks_tag(&_alloc_tag, _do_alloc);			\
+})
+
 #endif /* _LINUX_ALLOC_TAG_H */
include/linux/gfp.h renamed from include/linux/gfp.h~mm-enable-page-allocation-tagging +79 -47

219 lines not on this page · raw message

include/linux/pagemap.h renamed from include/linux/pagemap.h~mm-enable-page-allocation-tagging +6 -3
@@ -542,14 +542,17 @@ static inline void *detach_page_private(
 #endif
 
 #ifdef CONFIG_NUMA
-struct folio *filemap_alloc_folio(gfp_t gfp, unsigned int order);
+struct folio *filemap_alloc_folio_noprof(gfp_t gfp, unsigned int order);
 #else
-static inline struct folio *filemap_alloc_folio(gfp_t gfp, unsigned int order)
+static inline struct folio *filemap_alloc_folio_noprof(gfp_t gfp, unsigned int order)
 {
-	return folio_alloc(gfp, order);
+	return folio_alloc_noprof(gfp, order);
 }
 #endif
 
+#define filemap_alloc_folio(...)				\
+	alloc_hooks(filemap_alloc_folio_noprof(__VA_ARGS__))
+
 static inline struct page *__page_cache_alloc(gfp_t gfp)
 {
 	return &filemap_alloc_folio(gfp, 0)->page;
mm/compaction.c renamed from mm/compaction.c~mm-enable-page-allocation-tagging +6 -1
@@ -1851,7 +1851,7 @@ static void isolate_freepages(struct com
  * This is a migrate-callback that "allocates" freepages by taking pages
  * from the isolated freelists in the block we are migrating to.
  */
-static struct folio *compaction_alloc(struct folio *src, unsigned long data)
+static struct folio *compaction_alloc_noprof(struct folio *src, unsigned long data)
 {
 	struct compact_control *cc = (struct compact_control *)data;
 	struct folio *dst;
@@ -1898,6 +1898,11 @@ again:
 	return page_rmappable_folio(&dst->page);
 }
 
+static struct folio *compaction_alloc(struct folio *src, unsigned long data)
+{
+	return alloc_hooks(compaction_alloc_noprof(src, data));
+}
+
 /*
  * This is a migrate-callback that "frees" freepages back to the isolated
  * freelist.  All pages on the freelist are from the same zone, so there is no
mm/filemap.c renamed from mm/filemap.c~mm-enable-page-allocation-tagging +3 -3
@@ -966,7 +966,7 @@ int filemap_add_folio(struct address_spa
 EXPORT_SYMBOL_GPL(filemap_add_folio);
 
 #ifdef CONFIG_NUMA
-struct folio *filemap_alloc_folio(gfp_t gfp, unsigned int order)
+struct folio *filemap_alloc_folio_noprof(gfp_t gfp, unsigned int order)
 {
 	int n;
 	struct folio *folio;
@@ -981,9 +981,9 @@ struct folio *filemap_alloc_folio(gfp_t
 
 		return folio;
 	}
-	return folio_alloc(gfp, order);
+	return folio_alloc_noprof(gfp, order);
 }
-EXPORT_SYMBOL(filemap_alloc_folio);
+EXPORT_SYMBOL(filemap_alloc_folio_noprof);
 #endif
 
 /*
mm/mempolicy.c renamed from mm/mempolicy.c~mm-enable-page-allocation-tagging +23 -23

134 lines not on this page · raw message

mm/page_alloc.c renamed from mm/page_alloc.c~mm-enable-page-allocation-tagging +26 -26

152 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are

userfaultfd-remove-write_once-when-setting-folio-index-during-uffdio_move.patch