Skip to contentSkip to conversation

maple_tree-add-mas_for_each_rev-helper.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Nov 6, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: maple_tree: add mas_for_each_rev() helper
has been removed from the -mm tree. Its filename was
maple_tree-add-mas_for_each_rev-helper.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: maple_tree: add mas_for_each_rev() helper
Date: Wed, 23 Oct 2024 10:07:54 -0700

Patch series "page allocation tag compression", v4.

This patchset implements several improvements:

1. Gracefully handles module unloading while there are used allocations allocated from that module;

2. Provides an option to store page allocation tag references in the page flags, removing dependency on page extensions and eliminating the memory overhead from storing page allocation references (~0.2% of total system memory). This also improves page allocation performance when CONFIG_MEM_ALLOC_PROFILING is enabled by eliminating page extension lookup. Page allocation performance overhead is reduced from 41% to 5.5%.

Patch #1 introduces mas_for_each_rev() helper function.

Patch #2 introduces shutdown_mem_profiling() helper function to be used when disabling memory allocation profiling.

Patch #3 copies module tags into virtually contiguous memory which serves two purposes:

- Lets us deal with the situation when module is unloaded while there are still live allocations from that module. Since we are using a copy version of the tags we can safely unload the module. Space and gaps in this contiguous memory are managed using a maple tree.

- Enables simple indexing of the tags in the later patches.

Patch #4 changes the way we allocate virtually contiguous memory for module tags to reserve only vitrual area and populate physical pages only as needed at module load time.

Patch #5 abstracts page allocation tag reference to simplify later changes.

Patch #6 adds compression option to the sysctl.vm.mem_profiling boot parameter for storing page allocation tag references inside page flags if they fit. If the number of available page flag bits is insufficient to address all kernel allocations, memory allocation profiling gets disabled with an appropriate warning.

This patch (of 6):

Add mas_for_each_rev() function to iterate maple tree nodes in reverse order.

Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Borislav Petkov (AMD) <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Daniel Gomez <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Davidlohr Bueso <[email protected]>
Cc David Rientjes <[email protected]>
Cc Dennis Zhou <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc John Hubbard <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Joonsoo Kim <[email protected]>
Cc Kalesh Singh <[email protected]>
Cc Kees Cook <[email protected]>
Cc Kent Overstreet <[email protected]>
Cc Luis Chamberlain <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport (Microsoft) <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Paul E. McKenney <[email protected]>
Cc Petr Pavlu <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Sami Tolvanen <[email protected]>
Cc Sourav Panda <[email protected]>
Cc Steven Rostedt (Google) <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Thomas Huth <[email protected]>
Cc Uladzislau Rezki (Sony) <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Xiongwei Song <[email protected]>
Cc Yu Zhao <[email protected]>

---

 include/linux/maple_tree.h |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
include/linux/maple_tree.h renamed from include/linux/maple_tree.h~maple_tree-add-mas_for_each_rev-helper +14 -0
@@ -592,6 +592,20 @@ static __always_inline void mas_reset(st
 #define mas_for_each(__mas, __entry, __max) \
 	while (((__entry) = mas_find((__mas), (__max))) != NULL)
 
+/**
+ * mas_for_each_rev() - Iterate over a range of the maple tree in reverse order.
+ * @__mas: Maple Tree operation state (maple_state)
+ * @__entry: Entry retrieved from the tree
+ * @__min: minimum index to retrieve from the tree
+ *
+ * When returned, mas->index and mas->last will hold the entire range for the
+ * entry.
+ *
+ * Note: may return the zero entry.
+ */
+#define mas_for_each_rev(__mas, __entry, __min) \
+	while (((__entry) = mas_find_rev((__mas), (__min))) != NULL)
+
 #ifdef CONFIG_DEBUG_MAPLE_TREE
 enum mt_dump_format {
 	mt_dump_dec,

_

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

mm-convert-mm_lock_seq-to-a-proper-seqcount.patch
mm-introduce-mmap_lock_speculation_beginend.patch