Skip to contentSkip to conversation

page allocation tag compression

PATCH Superseded Suren Baghdasaryan 6 participants 29 messages Sep 2, 2024 – Sep 4, 2024

Subsystems (12)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Suren Baghdasaryan

author maintainer
#0 lore raw

v2 cover page allocation tag compression

This patchset implements several improvements:
1. Gracefully handles module unloading while there are used allocations allocated from that module;
2. Provides an option to reduce memory overhead from storing page allocation references by indexing allocation tags;
3. 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).
4. Improves page allocation performance when CONFIG_MEM_ALLOC_PROFILING is enabled by eliminating page extension lookup. Page allocation performance overhead is reduced from 14% to 5.5%.

Patch #1 introduces mas_for_each_rev() helper function.

Patch #2 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.

Preallocated virtually contiguous memory size can be configured using max_module_alloc_tags kernel parameter.

Patch #3 is a code cleanup to simplify later changes.

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

Patch #5 lets us control page allocation tag reference sizes and introduces tag indexing.

Patch #6 adds a config to store page allocation tag references inside page flags if they fit.

Patchset applies to mm-unstable.

Changes since v1 [1]:
- introduced mas_for_each_rev() and use it, per Liam Howlett
- use advanced maple_tree API to minimize lookups, per Liam Howlett
- fixed CONFIG_MODULES=n configuration build, per kernel test robot

[1] https://lore.kernel.org/all/[email protected]/

Suren Baghdasaryan (6):
maple_tree: add mas_for_each_rev() helper
alloc_tag: load module tags into separate continuous memory
alloc_tag: eliminate alloc_tag_ref_set
alloc_tag: introduce pgalloc_tag_ref to abstract page tag references
alloc_tag: make page allocation tag reference size configurable
alloc_tag: config to store page allocation tag refs in page flags

 .../admin-guide/kernel-parameters.txt         |   4 +
 include/asm-generic/codetag.lds.h             |  19 ++
 include/linux/alloc_tag.h                     |  46 ++-
 include/linux/codetag.h                       |  40 ++-
 include/linux/maple_tree.h                    |  14 +
 include/linux/mmzone.h                        |   3 +
 include/linux/page-flags-layout.h             |  10 +-
 include/linux/pgalloc_tag.h                   | 287 +++++++++++++---
 kernel/module/main.c                          |  67 ++--
 lib/Kconfig.debug                             |  36 +-
 lib/alloc_tag.c                               | 321 ++++++++++++++++--
 lib/codetag.c                                 | 104 +++++-
 mm/mm_init.c                                  |   1 +
 mm/page_ext.c                                 |   2 +-
 scripts/module.lds.S                          |   5 +-
 15 files changed, 826 insertions(+), 133 deletions(-)

base-commit: 18d35b7e30d5a217ff1cc976bb819e1aa2873301

Signature · 1 line
2.46.0.469.g59c65b2a67-goog
author maintainer
#1 lore raw

PATCH v2 1/6 maple_tree: add mas_for_each_rev() helper

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

---
 include/linux/maple_tree.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
include/linux/maple_tree.h +14 -0
index 8e1504a81cd2..45e633806da2 100644
@@ -592,6 +592,20 @@ static __always_inline void mas_reset(struct ma_state *mas)
 #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,
Signature · 1 line
2.46.0.469.g59c65b2a67-goog
author maintainer
#2 lore raw

PATCH v2 2/6 alloc_tag: load module tags into separate continuous memory

In reply to Suren Baghdasaryan

When a module gets unloaded there is a possibility that some of the allocations it made are still used and therefore the allocation tags corresponding to these allocations are still referenced. As such, the memory for these tags can't be freed. This is currently handled as an abnormal situation and module's data section is not being unloaded. To handle this situation without keeping module's data in memory, allow codetags with longer lifespan than the module to be loaded into their own separate memory. The in-use memory areas and gaps after module unloading in this separate memory are tracked using maple trees. Allocation tags arrange their separate memory so that it is virtually contiguous and that will allow simple allocation tag indexing later on in this patchset. The size of this virtually contiguous memory is set to store up to 100000 allocation tags and max_module_alloc_tags kernel parameter is introduced to change this size.

---
 .../admin-guide/kernel-parameters.txt         |   4 +
 include/asm-generic/codetag.lds.h             |  19 ++
 include/linux/alloc_tag.h                     |  13 +-
 include/linux/codetag.h                       |  37 ++-
 kernel/module/main.c                          |  67 +++--
 lib/alloc_tag.c                               | 265 ++++++++++++++++--
 lib/codetag.c                                 | 100 ++++++-
 scripts/module.lds.S                          |   5 +-
 8 files changed, 451 insertions(+), 59 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +4 -0
index 8dd0aefea01e..991b1c9ecf0e 100644
@@ -3205,6 +3205,10 @@
 			devices can be requested on-demand with the
 			/dev/loop-control interface.
 
+
+	max_module_alloc_tags=	[KNL] Max supported number of allocation tags
+			in modules.
+
 	mce		[X86-32] Machine Check Exception
 
 	mce=option	[X86-64] See Documentation/arch/x86/x86_64/boot-options.rst
include/asm-generic/codetag.lds.h +19 -0
index 64f536b80380..372c320c5043 100644
@@ -11,4 +11,23 @@
 #define CODETAG_SECTIONS()		\
 	SECTION_WITH_BOUNDARIES(alloc_tags)
 
+/*
+ * Module codetags which aren't used after module unload, therefore have the
+ * same lifespan as the module and can be safely unloaded with the module.
+ */
+#define MOD_CODETAG_SECTIONS()
+
+#define MOD_SEPARATE_CODETAG_SECTION(_name)	\
+	.codetag.##_name : {			\
+		SECTION_WITH_BOUNDARIES(_name)	\
+	}
+
+/*
+ * For codetags which might be used after module unload, therefore might stay
+ * longer in memory. Each such codetag type has its own section so that we can
+ * unload them individually once unused.
+ */
+#define MOD_SEPARATE_CODETAG_SECTIONS()		\
+	MOD_SEPARATE_CODETAG_SECTION(alloc_tags)
+
 #endif /* __ASM_GENERIC_CODETAG_LDS_H */
include/linux/alloc_tag.h +11 -2
index 8c61ccd161ba..99cbc7f086ad 100644
@@ -30,6 +30,13 @@ struct alloc_tag {
 	struct alloc_tag_counters __percpu	*counters;
 } __aligned(8);
 
+struct alloc_tag_module_section {
+	unsigned long start_addr;
+	unsigned long end_addr;
+	/* used size */
+	unsigned long size;
+};
+
 #ifdef CONFIG_MEM_ALLOC_PROFILING_DEBUG
 
 #define CODETAG_EMPTY	((void *)1)
@@ -54,6 +61,8 @@ static inline void set_codetag_empty(union codetag_ref *ref) {}
 
 #ifdef CONFIG_MEM_ALLOC_PROFILING
 
+#define ALLOC_TAG_SECTION_NAME	"alloc_tags"
+
 struct codetag_bytes {
 	struct codetag *ct;
 	s64 bytes;
@@ -76,7 +85,7 @@ DECLARE_PER_CPU(struct alloc_tag_counters, _shared_alloc_tag);
 
 #define DEFINE_ALLOC_TAG(_alloc_tag)						\
 	static struct alloc_tag _alloc_tag __used __aligned(8)			\
-	__section("alloc_tags") = {						\
+	__section(ALLOC_TAG_SECTION_NAME) = {					\
 		.ct = CODE_TAG_INIT,						\
 		.counters = &_shared_alloc_tag };
 
@@ -85,7 +94,7 @@ DECLARE_PER_CPU(struct alloc_tag_counters, _shared_alloc_tag);
 #define DEFINE_ALLOC_TAG(_alloc_tag)						\
 	static DEFINE_PER_CPU(struct alloc_tag_counters, _alloc_tag_cntr);	\
 	static struct alloc_tag _alloc_tag __used __aligned(8)			\
-	__section("alloc_tags") = {						\
+	__section(ALLOC_TAG_SECTION_NAME) = {					\
 		.ct = CODE_TAG_INIT,						\
 		.counters = &_alloc_tag_cntr };
 
include/linux/codetag.h +32 -5
index c2a579ccd455..fb4e7adfa746 100644
@@ -35,8 +35,15 @@ struct codetag_type_desc {
 	size_t tag_size;
 	void (*module_load)(struct codetag_type *cttype,
 			    struct codetag_module *cmod);
-	bool (*module_unload)(struct codetag_type *cttype,
+	void (*module_unload)(struct codetag_type *cttype,
 			      struct codetag_module *cmod);
+#ifdef CONFIG_MODULES
+	void (*module_replaced)(struct module *mod, struct module *new_mod);
+	bool (*needs_section_mem)(struct module *mod, unsigned long size);
+	void *(*alloc_section_mem)(struct module *mod, unsigned long size,
+				   unsigned int prepend, unsigned long align);
+	void (*free_section_mem)(struct module *mod, bool unused);
+#endif
 };
 
 struct codetag_iterator {
@@ -71,11 +78,31 @@ struct codetag_type *
 codetag_register_type(const struct codetag_type_desc *desc);
 
 #if defined(CONFIG_CODE_TAGGING) && defined(CONFIG_MODULES)
+
+bool codetag_needs_module_section(struct module *mod, const char *name,
+				  unsigned long size);
+void *codetag_alloc_module_section(struct module *mod, const char *name,
+				   unsigned long size, unsigned int prepend,
+				   unsigned long align);
+void codetag_free_module_sections(struct module *mod);
+void codetag_module_replaced(struct module *mod, struct module *new_mod);
 void codetag_load_module(struct module *mod);
-bool codetag_unload_module(struct module *mod);
-#else
+void codetag_unload_module(struct module *mod);
+
+#else /* defined(CONFIG_CODE_TAGGING) && defined(CONFIG_MODULES) */
+
+static inline bool
+codetag_needs_module_section(struct module *mod, const char *name,
+			     unsigned long size) { return false; }
+static inline void *
+codetag_alloc_module_section(struct module *mod, const char *name,
+			     unsigned long size, unsigned int prepend,
+			     unsigned long align) { return NULL; }
+static inline void codetag_free_module_sections(struct module *mod) {}
+static inline void codetag_module_replaced(struct module *mod, struct module *new_mod) {}
 static inline void codetag_load_module(struct module *mod) {}
-static inline bool codetag_unload_module(struct module *mod) { return true; }
-#endif
+static inline void codetag_unload_module(struct module *mod) {}
+
+#endif /* defined(CONFIG_CODE_TAGGING) && defined(CONFIG_MODULES) */
 
 #endif /* _LINUX_CODETAG_H */
kernel/module/main.c +43 -24

152 lines not on this page · raw message

lib/alloc_tag.c +246 -19

295 lines not on this page · raw message

lib/codetag.c +93 -7

130 lines not on this page · raw message

scripts/module.lds.S +3 -2
index 3f43edef813c..711c6e029936 100644
@@ -50,7 +50,7 @@ SECTIONS {
 	.data : {
 		*(.data .data.[0-9a-zA-Z_]*)
 		*(.data..L*)
-		CODETAG_SECTIONS()
+		MOD_CODETAG_SECTIONS()
 	}
 
 	.rodata : {
@@ -59,9 +59,10 @@ SECTIONS {
 	}
 #else
 	.data : {
-		CODETAG_SECTIONS()
+		MOD_CODETAG_SECTIONS()
 	}
 #endif
+	MOD_SEPARATE_CODETAG_SECTIONS()
 }
 
 /* bring in arch-specific sections */
Signature · 1 line
2.46.0.469.g59c65b2a67-goog
author maintainer
#3 lore raw

PATCH v2 3/6 alloc_tag: eliminate alloc_tag_ref_set

In reply to Suren Baghdasaryan

To simplify further refactoring, open-code the only two callers of alloc_tag_ref_set().

---
 include/linux/alloc_tag.h   | 25 ++-----------------------
 include/linux/pgalloc_tag.h | 12 +++++++++++-
 2 files changed, 13 insertions(+), 24 deletions(-)
include/linux/alloc_tag.h +2 -23
index 99cbc7f086ad..21e3098220e3 100644
@@ -143,36 +143,15 @@ static inline void alloc_tag_add_check(union codetag_ref *ref, struct alloc_tag
 static inline void alloc_tag_sub_check(union codetag_ref *ref) {}
 #endif
 
-/* Caller should verify both ref and tag to be valid */
-static inline void __alloc_tag_ref_set(union codetag_ref *ref, struct alloc_tag *tag)
-{
-	ref->ct = &tag->ct;
-	/*
-	 * We need in increment the call counter every time we have a new
-	 * allocation or when we split a large allocation into smaller ones.
-	 * Each new reference for every sub-allocation needs to increment call
-	 * counter because when we free each part the counter will be decremented.
-	 */
-	this_cpu_inc(tag->counters->calls);
-}
-
-static inline void alloc_tag_ref_set(union codetag_ref *ref, struct alloc_tag *tag)
-{
-	alloc_tag_add_check(ref, tag);
-	if (!ref || !tag)
-		return;
-
-	__alloc_tag_ref_set(ref, tag);
-}
-
 static inline void alloc_tag_add(union codetag_ref *ref, struct alloc_tag *tag, size_t bytes)
 {
 	alloc_tag_add_check(ref, tag);
 	if (!ref || !tag)
 		return;
 
-	__alloc_tag_ref_set(ref, tag);
+	ref->ct = &tag->ct;
 	this_cpu_add(tag->counters->bytes, bytes);
+	this_cpu_inc(tag->counters->calls);
 }
 
 static inline void alloc_tag_sub(union codetag_ref *ref, size_t bytes)
include/linux/pgalloc_tag.h +11 -1
index 207f0c83c8e9..244a328dff62 100644
@@ -103,7 +103,17 @@ static inline void pgalloc_tag_split(struct page *page, unsigned int nr)
 	page_ext = page_ext_next(page_ext);
 	for (i = 1; i < nr; i++) {
 		/* Set new reference to point to the original tag */
-		alloc_tag_ref_set(codetag_ref_from_page_ext(page_ext), tag);
+		ref = codetag_ref_from_page_ext(page_ext);
+		alloc_tag_add_check(ref, tag);
+		if (ref) {
+			ref->ct = &tag->ct;
+			/*
+			 * We need in increment the call counter every time we split a
+			 * large allocation into smaller ones because when we free each
+			 * part the counter will be decremented.
+			 */
+			this_cpu_inc(tag->counters->calls);
+		}
 		page_ext = page_ext_next(page_ext);
 	}
 out:
Signature · 1 line
2.46.0.469.g59c65b2a67-goog
author maintainer
#4 lore raw

PATCH v2 4/6 alloc_tag: introduce pgalloc_tag_ref to abstract page tag references

In reply to Suren Baghdasaryan

To simplify later changes to page tag references, introduce new pgalloc_tag_ref and pgtag_ref_handle types. This allows easy replacement of page_ext as a storage of page allocation tags

---
 include/linux/pgalloc_tag.h | 144 +++++++++++++++++++++++-------------
 lib/alloc_tag.c             |   3 +-
 2 files changed, 95 insertions(+), 52 deletions(-)
include/linux/pgalloc_tag.h +93 -51
index 244a328dff62..c76b629d0206 100644
@@ -9,48 +9,76 @@
 
 #ifdef CONFIG_MEM_ALLOC_PROFILING
 
+typedef union codetag_ref	pgalloc_tag_ref;
+
+static inline void read_pgref(pgalloc_tag_ref *pgref, union codetag_ref *ref)
+{
+	ref->ct = pgref->ct;
+}
+
+static inline void write_pgref(pgalloc_tag_ref *pgref, union codetag_ref *ref)
+{
+	pgref->ct = ref->ct;
+}
 #include <linux/page_ext.h>
 
 extern struct page_ext_operations page_alloc_tagging_ops;
 
-static inline union codetag_ref *codetag_ref_from_page_ext(struct page_ext *page_ext)
+static inline pgalloc_tag_ref *pgref_from_page_ext(struct page_ext *page_ext)
 {
-	return (union codetag_ref *)page_ext_data(page_ext, &page_alloc_tagging_ops);
+	return (pgalloc_tag_ref *)page_ext_data(page_ext, &page_alloc_tagging_ops);
 }
 
-static inline struct page_ext *page_ext_from_codetag_ref(union codetag_ref *ref)
+static inline struct page_ext *page_ext_from_pgref(pgalloc_tag_ref *pgref)
 {
-	return (void *)ref - page_alloc_tagging_ops.offset;
+	return (void *)pgref - page_alloc_tagging_ops.offset;
 }
 
+typedef pgalloc_tag_ref	*pgtag_ref_handle;
+
 /* Should be called only if mem_alloc_profiling_enabled() */
-static inline union codetag_ref *get_page_tag_ref(struct page *page)
+static inline pgtag_ref_handle get_page_tag_ref(struct page *page, union codetag_ref *ref)
 {
 	if (page) {
 		struct page_ext *page_ext = page_ext_get(page);
 
-		if (page_ext)
-			return codetag_ref_from_page_ext(page_ext);
+		if (page_ext) {
+			pgalloc_tag_ref *pgref = pgref_from_page_ext(page_ext);
+
+			read_pgref(pgref, ref);
+			return pgref;
+		}
 	}
 	return NULL;
 }
 
-static inline void put_page_tag_ref(union codetag_ref *ref)
+static inline void put_page_tag_ref(pgtag_ref_handle pgref)
 {
-	if (WARN_ON(!ref))
+	if (WARN_ON(!pgref))
 		return;
 
-	page_ext_put(page_ext_from_codetag_ref(ref));
+	page_ext_put(page_ext_from_pgref(pgref));
+}
+
+static inline void update_page_tag_ref(pgtag_ref_handle pgref, union codetag_ref *ref)
+{
+	if (WARN_ON(!pgref || !ref))
+		return;
+
+	write_pgref(pgref, ref);
 }
 
 static inline void clear_page_tag_ref(struct page *page)
 {
 	if (mem_alloc_profiling_enabled()) {
-		union codetag_ref *ref = get_page_tag_ref(page);
-
-		if (ref) {
-			set_codetag_empty(ref);
-			put_page_tag_ref(ref);
+		pgtag_ref_handle handle;
+		union codetag_ref ref;
+
+		handle = get_page_tag_ref(page, &ref);
+		if (handle) {
+			set_codetag_empty(&ref);
+			update_page_tag_ref(handle, &ref);
+			put_page_tag_ref(handle);
 		}
 	}
 }
@@ -59,11 +87,14 @@ static inline void pgalloc_tag_add(struct page *page, struct task_struct *task,
 				   unsigned int nr)
 {
 	if (mem_alloc_profiling_enabled()) {
-		union codetag_ref *ref = get_page_tag_ref(page);
-
-		if (ref) {
-			alloc_tag_add(ref, task->alloc_tag, PAGE_SIZE * nr);
-			put_page_tag_ref(ref);
+		pgtag_ref_handle handle;
+		union codetag_ref ref;
+
+		handle = get_page_tag_ref(page, &ref);
+		if (handle) {
+			alloc_tag_add(&ref, task->alloc_tag, PAGE_SIZE * nr);
+			update_page_tag_ref(handle, &ref);
+			put_page_tag_ref(handle);
 		}
 	}
 }
@@ -71,53 +102,58 @@ static inline void pgalloc_tag_add(struct page *page, struct task_struct *task,
 static inline void pgalloc_tag_sub(struct page *page, unsigned int nr)
 {
 	if (mem_alloc_profiling_enabled()) {
-		union codetag_ref *ref = get_page_tag_ref(page);
-
-		if (ref) {
-			alloc_tag_sub(ref, PAGE_SIZE * nr);
-			put_page_tag_ref(ref);
+		pgtag_ref_handle handle;
+		union codetag_ref ref;
+
+		handle = get_page_tag_ref(page, &ref);
+		if (handle) {
+			alloc_tag_sub(&ref, PAGE_SIZE * nr);
+			update_page_tag_ref(handle, &ref);
+			put_page_tag_ref(handle);
 		}
 	}
 }
 
 static inline void pgalloc_tag_split(struct page *page, unsigned int nr)
 {
-	int i;
-	struct page_ext *first_page_ext;
-	struct page_ext *page_ext;
-	union codetag_ref *ref;
+	pgtag_ref_handle first_pgref;
+	union codetag_ref first_ref;
 	struct alloc_tag *tag;
+	int i;
 
 	if (!mem_alloc_profiling_enabled())
 		return;
 
-	first_page_ext = page_ext = page_ext_get(page);
-	if (unlikely(!page_ext))
+	first_pgref = get_page_tag_ref(page, &first_ref);
+	if (unlikely(!first_pgref))
 		return;
 
-	ref = codetag_ref_from_page_ext(page_ext);
-	if (!ref->ct)
+	if (!first_ref.ct)
 		goto out;
 
-	tag = ct_to_alloc_tag(ref->ct);
-	page_ext = page_ext_next(page_ext);
+	tag = ct_to_alloc_tag(first_ref.ct);
 	for (i = 1; i < nr; i++) {
-		/* Set new reference to point to the original tag */
-		ref = codetag_ref_from_page_ext(page_ext);
-		alloc_tag_add_check(ref, tag);
-		if (ref) {
-			ref->ct = &tag->ct;
+		pgtag_ref_handle handle;
+		union codetag_ref ref;
+
+		page++;
+		handle = get_page_tag_ref(page, &ref);
+		if (handle) {
+			/* Set new reference to point to the original tag */
+			alloc_tag_add_check(&ref, tag);
+			ref.ct = &tag->ct;
 			/*
 			 * We need in increment the call counter every time we split a
 			 * large allocation into smaller ones because when we free each
 			 * part the counter will be decremented.
 			 */
 			this_cpu_inc(tag->counters->calls);
+			update_page_tag_ref(handle, &ref);
+			put_page_tag_ref(handle);
 		}
-		page_ext = page_ext_next(page_ext);
 	}
 out:
-	page_ext_put(first_page_ext);
+	put_page_tag_ref(first_pgref);
 }
 
 static inline struct alloc_tag *pgalloc_tag_get(struct page *page)
@@ -125,13 +161,15 @@ static inline struct alloc_tag *pgalloc_tag_get(struct page *page)
 	struct alloc_tag *tag = NULL;
 
 	if (mem_alloc_profiling_enabled()) {
-		union codetag_ref *ref = get_page_tag_ref(page);
-
-		alloc_tag_sub_check(ref);
-		if (ref) {
-			if (ref->ct)
-				tag = ct_to_alloc_tag(ref->ct);
-			put_page_tag_ref(ref);
+		pgtag_ref_handle handle;
+		union codetag_ref ref;
+
+		handle = get_page_tag_ref(page, &ref);
+		if (handle) {
+			alloc_tag_sub_check(&ref);
+			if (ref.ct)
+				tag = ct_to_alloc_tag(ref.ct);
+			put_page_tag_ref(handle);
 		}
 	}
 
@@ -146,8 +184,12 @@ static inline void pgalloc_tag_sub_pages(struct alloc_tag *tag, unsigned int nr)
 
 #else /* CONFIG_MEM_ALLOC_PROFILING */
 
-static inline union codetag_ref *get_page_tag_ref(struct page *page) { return NULL; }
-static inline void put_page_tag_ref(union codetag_ref *ref) {}
+typedef void	*pgtag_ref_handle;
+
+static inline pgtag_ref_handle
+get_page_tag_ref(struct page *page, union codetag_ref *ref) { return NULL; }
+static inline void put_page_tag_ref(pgtag_ref_handle handle) {}
+static inline void update_page_tag_ref(pgtag_ref_handle handle, union codetag_ref *ref) {}
 static inline void clear_page_tag_ref(struct page *page) {}
 static inline void pgalloc_tag_add(struct page *page, struct task_struct *task,
 				   unsigned int nr) {}
lib/alloc_tag.c +2 -1
index 19ef02a18611..53bd3236d30b 100644
@@ -5,6 +5,7 @@
 #include <linux/gfp.h>
 #include <linux/module.h>
 #include <linux/page_ext.h>
+#include <linux/pgalloc_tag.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_buf.h>
 #include <linux/seq_file.h>
@@ -436,7 +437,7 @@ static __init void init_page_alloc_tagging(void)
 }
 
 struct page_ext_operations page_alloc_tagging_ops = {
-	.size = sizeof(union codetag_ref),
+	.size = sizeof(pgalloc_tag_ref),
 	.need = need_page_alloc_tagging,
 	.init = init_page_alloc_tagging,
 };
Signature · 1 line
2.46.0.469.g59c65b2a67-goog
author maintainer
#5 lore raw

PATCH v2 5/6 alloc_tag: make page allocation tag reference size configurable

In reply to Suren Baghdasaryan

Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the page allocation tag references. When the size is configured to be less than a direct pointer, the tags are searched using an index stored as the tag reference.

---
 include/linux/alloc_tag.h   | 10 +++-
 include/linux/codetag.h     |  3 ++
 include/linux/pgalloc_tag.h | 99 +++++++++++++++++++++++++++++++++++++
 lib/Kconfig.debug           | 11 +++++
 lib/alloc_tag.c             | 51 ++++++++++++++++++-
 lib/codetag.c               |  4 +-
 mm/mm_init.c                |  1 +
 7 files changed, 175 insertions(+), 4 deletions(-)
include/linux/alloc_tag.h +9 -1
index 21e3098220e3..b5cf24517333 100644
@@ -30,8 +30,16 @@ struct alloc_tag {
 	struct alloc_tag_counters __percpu	*counters;
 } __aligned(8);
 
+struct alloc_tag_kernel_section {
+	struct alloc_tag *first_tag;
+	unsigned long count;
+};
+
 struct alloc_tag_module_section {
-	unsigned long start_addr;
+	union {
+		unsigned long start_addr;
+		struct alloc_tag *first_tag;
+	};
 	unsigned long end_addr;
 	/* used size */
 	unsigned long size;
include/linux/codetag.h +3 -0
index fb4e7adfa746..401fc297eeda 100644
@@ -13,6 +13,9 @@ struct codetag_module;
 struct seq_buf;
 struct module;
 
+#define CODETAG_SECTION_START_PREFIX	"__start_"
+#define CODETAG_SECTION_STOP_PREFIX	"__stop_"
+
 /*
  * An instance of this structure is created in a special ELF section at every
  * code location being tagged.  At runtime, the special section is treated as
include/linux/pgalloc_tag.h +99 -0

118 lines not on this page · raw message

lib/Kconfig.debug +11 -0
index a30c03a66172..253f9c2028da 100644
@@ -1000,6 +1000,17 @@ config MEM_ALLOC_PROFILING_DEBUG
 	  Adds warnings with helpful error messages for memory allocation
 	  profiling.
 
+config PGALLOC_TAG_REF_BITS
+	int "Number of bits for page allocation tag reference (10-64)"
+	range 10 64
+	default "64"
+	depends on MEM_ALLOC_PROFILING
+	help
+	  Number of bits used to encode a page allocation tag reference.
+
+	  Smaller number results in less memory overhead but limits the number of
+	  allocations which can be tagged (including allocations from modules).
+
 source "lib/Kconfig.kasan"
 source "lib/Kconfig.kfence"
 source "lib/Kconfig.kmsan"
lib/alloc_tag.c +50 -1

81 lines not on this page · raw message

lib/codetag.c +2 -2
index 60463ef4bb85..cb3aa1631417 100644
@@ -149,8 +149,8 @@ static struct codetag_range get_section_range(struct module *mod,
 					      const char *section)
 {
 	return (struct codetag_range) {
-		get_symbol(mod, "__start_", section),
-		get_symbol(mod, "__stop_", section),
+		get_symbol(mod, CODETAG_SECTION_START_PREFIX, section),
+		get_symbol(mod, CODETAG_SECTION_STOP_PREFIX, section),
 	};
 }
 
mm/mm_init.c +1 -0
index 4ba5607aaf19..231a95782455 100644
@@ -2650,6 +2650,7 @@ void __init mm_core_init(void)
 	report_meminit();
 	kmsan_init_shadow();
 	stack_depot_early_init();
+	alloc_tag_sec_init();
 	mem_init();
 	kmem_cache_init();
 	/*
Signature · 1 line
2.46.0.469.g59c65b2a67-goog
maintainer
#6 lore raw

Re: [PATCH v2 5/6] alloc_tag: make page allocation tag reference size configurable

Quoted 8 lines · On Sun, 1 Sep 2024 21:41:27 -0700 Suren Baghdasaryan <[email protected]> wrote:

Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the page allocation tag references. When the size is configured to be less than a direct pointer, the tags are searched using an index stored as the tag reference.

...

lib/Kconfig.debug +1 -0
+config PGALLOC_TAG_REF_BITS

lib/Kconfig.debug config MEM_ALLOC_PROFILING_DEBUG · line 1013

Quoted 10 lines
lib/Kconfig.debug +10 -0
+	int "Number of bits for page allocation tag reference (10-64)"
+	range 10 64
+	default "64"
+	depends on MEM_ALLOC_PROFILING
+	help
+	  Number of bits used to encode a page allocation tag reference.
+
+	  Smaller number results in less memory overhead but limits the number of
+	  allocations which can be tagged (including allocations from modules).
+

In other words, "we have no idea what's best for you, you're on your own".

I pity our poor users.

Can we at least tell them what they should look at to determine whether whatever random number they chose was helpful or harmful?

author maintainer
#7 lore raw

Re: [PATCH v2 5/6] alloc_tag: make page allocation tag reference size configurable

Quoted 25 lines · Andrew Morton
Quoted 8 lines · On Sun, 1 Sep 2024 21:41:27 -0700 Suren Baghdasaryan <[email protected]> wrote:

Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the page allocation tag references. When the size is configured to be less than a direct pointer, the tags are searched using an index stored as the tag reference.

...

lib/Kconfig.debug +1 -0
+config PGALLOC_TAG_REF_BITS

lib/Kconfig.debug config MEM_ALLOC_PROFILING_DEBUG · line 1013

Quoted 10 lines
lib/Kconfig.debug +10 -0
+     int "Number of bits for page allocation tag reference (10-64)"
+     range 10 64
+     default "64"
+     depends on MEM_ALLOC_PROFILING
+     help
+       Number of bits used to encode a page allocation tag reference.
+
+       Smaller number results in less memory overhead but limits the number of
+       allocations which can be tagged (including allocations from modules).
+

In other words, "we have no idea what's best for you, you're on your own".

Quoted 4 lines

I pity our poor users.

Can we at least tell them what they should look at to determine whether whatever random number they chose was helpful or harmful?

At the end of my reply in
https://lore.kernel.org/all/CAJuCfpGNYgx0GW4suHRzmxVH28RGRnFBvFC6WO+F8BD4HDqxXA@mail.gmail.com/#t
I suggested using all unused page flags. That would simplify things for the user at the expense of potentially using more memory than we need. In practice 13 bits should be more than enough to cover all kernel page allocations with enough headroom for page allocations coming from loadable modules. I guess using 13 as the default would cover most cases. In the unlikely case a specific system needs more tags, the user can increase this value. It can also be set to 64 to force direct references instead of indexing for better performance. Would that approach be acceptable?

Quoted 1 line
maintainer
#8 lore raw

Re: [PATCH v2 5/6] alloc_tag: make page allocation tag reference size configurable

Quoted 28 lines · Suren Baghdasaryan
Quoted 27 lines · Andrew Morton
Quoted 8 lines · On Sun, 1 Sep 2024 21:41:27 -0700 Suren Baghdasaryan <[email protected]> wrote:

Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the page allocation tag references. When the size is configured to be less than a direct pointer, the tags are searched using an index stored as the tag reference.

...

lib/Kconfig.debug +1 -0
+config PGALLOC_TAG_REF_BITS

lib/Kconfig.debug config MEM_ALLOC_PROFILING_DEBUG · line 1013

Quoted 10 lines
lib/Kconfig.debug +10 -0
+     int "Number of bits for page allocation tag reference (10-64)"
+     range 10 64
+     default "64"
+     depends on MEM_ALLOC_PROFILING
+     help
+       Number of bits used to encode a page allocation tag reference.
+
+       Smaller number results in less memory overhead but limits the number of
+       allocations which can be tagged (including allocations from modules).
+

In other words, "we have no idea what's best for you, you're on your own".

I pity our poor users.

Quoted 8 lines
Quoted 2 lines

Can we at least tell them what they should look at to determine whether whatever random number they chose was helpful or harmful?

At the end of my reply in
https://lore.kernel.org/all/CAJuCfpGNYgx0GW4suHRzmxVH28RGRnFBvFC6WO+F8BD4HDqxXA@mail.gmail.com/#t
I suggested using all unused page flags. That would simplify things for the user at the expense of potentially using more memory than we need.

Why would that use more memory, and how much?

Quoted 7 lines

In practice 13 bits should be more than enough to cover all kernel page allocations with enough headroom for page allocations coming from loadable modules. I guess using 13 as the default would cover most cases. In the unlikely case a specific system needs more tags, the user can increase this value. It can also be set to 64 to force direct references instead of indexing for better performance. Would that approach be acceptable?

Any knob that has to be kept track of and adjusted is a real hassle - e.g. lockdep has a bunch of knobs that have to be periodically tweaked, that's used by _developers_, and they're often wrong.

author maintainer
#9 lore raw

Re: [PATCH v2 5/6] alloc_tag: make page allocation tag reference size configurable

Quoted 33 lines · Kent Overstreet
Quoted 31 lines · Suren Baghdasaryan
Quoted 29 lines · Andrew Morton
Quoted 8 lines · On Sun, 1 Sep 2024 21:41:27 -0700 Suren Baghdasaryan <[email protected]> wrote:

Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the page allocation tag references. When the size is configured to be less than a direct pointer, the tags are searched using an index stored as the tag reference.

...

lib/Kconfig.debug +1 -0
+config PGALLOC_TAG_REF_BITS

lib/Kconfig.debug config MEM_ALLOC_PROFILING_DEBUG · line 1013

Quoted 10 lines
lib/Kconfig.debug +10 -0
+     int "Number of bits for page allocation tag reference (10-64)"
+     range 10 64
+     default "64"
+     depends on MEM_ALLOC_PROFILING
+     help
+       Number of bits used to encode a page allocation tag reference.
+
+       Smaller number results in less memory overhead but limits the number of
+       allocations which can be tagged (including allocations from modules).
+

In other words, "we have no idea what's best for you, you're on your own".

I pity our poor users.

Can we at least tell them what they should look at to determine whether whatever random number they chose was helpful or harmful?

Quoted 7 lines
Quoted 5 lines

At the end of my reply in
https://lore.kernel.org/all/CAJuCfpGNYgx0GW4suHRzmxVH28RGRnFBvFC6WO+F8BD4HDqxXA@mail.gmail.com/#t
I suggested using all unused page flags. That would simplify things for the user at the expense of potentially using more memory than we need.

Why would that use more memory, and how much?

Say our kernel uses 5000 page allocations and there are additional 100 allocations from all the modules we are loading at runtime. They all can be addressed using 13 bits (8192 addressable tags), so the contiguous memory we will be preallocating to store these tags is 8192
* sizeof(alloc_tag). sizeof(alloc_tag) is 40 bytes as of today but might increase in the future if we add more fields there for other uses (like gfp_flags for example). So, currently this would use 320KB. If we always use 16 bits we would be preallocating 2.5MB. So, that would be 2.2MB of wasted memory. Using more than 16 bits (65536 addressable tags) will be impractical anytime soon (current number IIRC is a bit over 4000).

Quoted 9 lines
Quoted 8 lines

In practice 13 bits should be more than enough to cover all kernel page allocations with enough headroom for page allocations coming from loadable modules. I guess using 13 as the default would cover most cases. In the unlikely case a specific system needs more tags, the user can increase this value. It can also be set to 64 to force direct references instead of indexing for better performance. Would that approach be acceptable?

Quoted 3 lines

Any knob that has to be kept track of and adjusted is a real hassle - e.g. lockdep has a bunch of knobs that have to be periodically tweaked, that's used by _developers_, and they're often wrong.

Yes, I understand, but this config would allow us not to waste these couple of MBs, provide a way for the user to request direct addressing of the tags and it also helps us to deal with the case I described in the last paragraph of my posting at
https://lore.kernel.org/all/CAJuCfpGNYgx0GW4suHRzmxVH28RGRnFBvFC6WO+F8BD4HDqxXA@mail.gmail.com/#t

maintainer
#10 lore raw

Re: [PATCH v2 5/6] alloc_tag: make page allocation tag reference size configurable

Quoted 43 lines · Suren Baghdasaryan
Quoted 33 lines · Kent Overstreet
Quoted 31 lines · Suren Baghdasaryan
Quoted 29 lines · Andrew Morton
Quoted 8 lines · On Sun, 1 Sep 2024 21:41:27 -0700 Suren Baghdasaryan <[email protected]> wrote:

Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the page allocation tag references. When the size is configured to be less than a direct pointer, the tags are searched using an index stored as the tag reference.

...

lib/Kconfig.debug +1 -0
+config PGALLOC_TAG_REF_BITS

lib/Kconfig.debug config MEM_ALLOC_PROFILING_DEBUG · line 1013

Quoted 10 lines
lib/Kconfig.debug +10 -0
+     int "Number of bits for page allocation tag reference (10-64)"
+     range 10 64
+     default "64"
+     depends on MEM_ALLOC_PROFILING
+     help
+       Number of bits used to encode a page allocation tag reference.
+
+       Smaller number results in less memory overhead but limits the number of
+       allocations which can be tagged (including allocations from modules).
+

In other words, "we have no idea what's best for you, you're on your own".

I pity our poor users.

Can we at least tell them what they should look at to determine whether whatever random number they chose was helpful or harmful?

Quoted 7 lines
Quoted 5 lines

At the end of my reply in
https://lore.kernel.org/all/CAJuCfpGNYgx0GW4suHRzmxVH28RGRnFBvFC6WO+F8BD4HDqxXA@mail.gmail.com/#t
I suggested using all unused page flags. That would simplify things for the user at the expense of potentially using more memory than we need.

Why would that use more memory, and how much?

Quoted 11 lines

Say our kernel uses 5000 page allocations and there are additional 100 allocations from all the modules we are loading at runtime. They all can be addressed using 13 bits (8192 addressable tags), so the contiguous memory we will be preallocating to store these tags is 8192
* sizeof(alloc_tag). sizeof(alloc_tag) is 40 bytes as of today but might increase in the future if we add more fields there for other uses (like gfp_flags for example). So, currently this would use 320KB. If we always use 16 bits we would be preallocating 2.5MB. So, that would be 2.2MB of wasted memory. Using more than 16 bits (65536 addressable tags) will be impractical anytime soon (current number IIRC is a bit over 4000).

I see, it's not about the page bits, it's about the contiguous array of alloc tags?

What if we just reserved address space, and only filled it in as needed?

author maintainer
#11 lore raw

Re: [PATCH v2 5/6] alloc_tag: make page allocation tag reference size configurable

Quoted 57 lines · Kent Overstreet
Quoted 43 lines · Suren Baghdasaryan
Quoted 33 lines · Kent Overstreet
Quoted 31 lines · Suren Baghdasaryan
Quoted 29 lines · Andrew Morton
Quoted 8 lines · On Sun, 1 Sep 2024 21:41:27 -0700 Suren Baghdasaryan <[email protected]> wrote:

Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the page allocation tag references. When the size is configured to be less than a direct pointer, the tags are searched using an index stored as the tag reference.

...

lib/Kconfig.debug +1 -0
+config PGALLOC_TAG_REF_BITS

lib/Kconfig.debug config MEM_ALLOC_PROFILING_DEBUG · line 1013

Quoted 10 lines
lib/Kconfig.debug +10 -0
+     int "Number of bits for page allocation tag reference (10-64)"
+     range 10 64
+     default "64"
+     depends on MEM_ALLOC_PROFILING
+     help
+       Number of bits used to encode a page allocation tag reference.
+
+       Smaller number results in less memory overhead but limits the number of
+       allocations which can be tagged (including allocations from modules).
+

In other words, "we have no idea what's best for you, you're on your own".

I pity our poor users.

Can we at least tell them what they should look at to determine whether whatever random number they chose was helpful or harmful?

Quoted 7 lines
Quoted 5 lines

At the end of my reply in
https://lore.kernel.org/all/CAJuCfpGNYgx0GW4suHRzmxVH28RGRnFBvFC6WO+F8BD4HDqxXA@mail.gmail.com/#t
I suggested using all unused page flags. That would simplify things for the user at the expense of potentially using more memory than we need.

Why would that use more memory, and how much?

Quoted 11 lines

Say our kernel uses 5000 page allocations and there are additional 100 allocations from all the modules we are loading at runtime. They all can be addressed using 13 bits (8192 addressable tags), so the contiguous memory we will be preallocating to store these tags is 8192
* sizeof(alloc_tag). sizeof(alloc_tag) is 40 bytes as of today but might increase in the future if we add more fields there for other uses (like gfp_flags for example). So, currently this would use 320KB. If we always use 16 bits we would be preallocating 2.5MB. So, that would be 2.2MB of wasted memory. Using more than 16 bits (65536 addressable tags) will be impractical anytime soon (current number IIRC is a bit over 4000).

Quoted 4 lines

I see, it's not about the page bits, it's about the contiguous array of alloc tags?

What if we just reserved address space, and only filled it in as needed?

That might be possible. I'll have to try that. Thanks!

author maintainer
#12 lore raw

PATCH v2 6/6 alloc_tag: config to store page allocation tag refs in page flags

In reply to Suren Baghdasaryan

Add CONFIG_PGALLOC_TAG_USE_PAGEFLAGS to store allocation tag references directly in the page flags. This removes dependency on page_ext and results in better performance for page allocations as well as reduced page_ext memory overhead. CONFIG_PGALLOC_TAG_REF_BITS controls the number of bits required to be available in the page flags to store the references. If the number of page flag bits is insufficient, the build will fail and either CONFIG_PGALLOC_TAG_REF_BITS would have to be lowered or CONFIG_PGALLOC_TAG_USE_PAGEFLAGS should be disabled.

---
 include/linux/mmzone.h            |  3 ++
 include/linux/page-flags-layout.h | 10 +++++--
 include/linux/pgalloc_tag.h       | 48 +++++++++++++++++++++++++++++++
 lib/Kconfig.debug                 | 27 +++++++++++++++--
 lib/alloc_tag.c                   |  4 +++
 mm/page_ext.c                     |  2 +-
 6 files changed, 89 insertions(+), 5 deletions(-)
include/linux/mmzone.h +3 -0
index 17506e4a2835..0dd2b42f7cb6 100644
@@ -1085,6 +1085,7 @@ static inline bool zone_is_empty(struct zone *zone)
 #define KASAN_TAG_PGOFF		(LAST_CPUPID_PGOFF - KASAN_TAG_WIDTH)
 #define LRU_GEN_PGOFF		(KASAN_TAG_PGOFF - LRU_GEN_WIDTH)
 #define LRU_REFS_PGOFF		(LRU_GEN_PGOFF - LRU_REFS_WIDTH)
+#define ALLOC_TAG_REF_PGOFF	(LRU_REFS_PGOFF - ALLOC_TAG_REF_WIDTH)
 
 /*
  * Define the bit shifts to access each section.  For non-existent
@@ -1096,6 +1097,7 @@ static inline bool zone_is_empty(struct zone *zone)
 #define ZONES_PGSHIFT		(ZONES_PGOFF * (ZONES_WIDTH != 0))
 #define LAST_CPUPID_PGSHIFT	(LAST_CPUPID_PGOFF * (LAST_CPUPID_WIDTH != 0))
 #define KASAN_TAG_PGSHIFT	(KASAN_TAG_PGOFF * (KASAN_TAG_WIDTH != 0))
+#define ALLOC_TAG_REF_PGSHIFT	(ALLOC_TAG_REF_PGOFF * (ALLOC_TAG_REF_WIDTH != 0))
 
 /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */
 #ifdef NODE_NOT_IN_PAGE_FLAGS
@@ -1116,6 +1118,7 @@ static inline bool zone_is_empty(struct zone *zone)
 #define LAST_CPUPID_MASK	((1UL << LAST_CPUPID_SHIFT) - 1)
 #define KASAN_TAG_MASK		((1UL << KASAN_TAG_WIDTH) - 1)
 #define ZONEID_MASK		((1UL << ZONEID_SHIFT) - 1)
+#define ALLOC_TAG_REF_MASK	((1UL << ALLOC_TAG_REF_WIDTH) - 1)
 
 static inline enum zone_type page_zonenum(const struct page *page)
 {
include/linux/page-flags-layout.h +8 -2
index 7d79818dc065..21bba7c8c965 100644
@@ -5,6 +5,12 @@
 #include <linux/numa.h>
 #include <generated/bounds.h>
 
+#ifdef CONFIG_PGALLOC_TAG_USE_PAGEFLAGS
+#define ALLOC_TAG_REF_WIDTH	CONFIG_PGALLOC_TAG_REF_BITS
+#else
+#define ALLOC_TAG_REF_WIDTH	0
+#endif
+
 /*
  * When a memory allocation must conform to specific limitations (such
  * as being suitable for DMA) the caller will pass in hints to the
@@ -91,7 +97,7 @@
 #endif
 
 #if ZONES_WIDTH + LRU_GEN_WIDTH + SECTIONS_WIDTH + NODES_WIDTH + \
-	KASAN_TAG_WIDTH + LAST_CPUPID_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS
+	KASAN_TAG_WIDTH + ALLOC_TAG_REF_WIDTH + LAST_CPUPID_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS
 #define LAST_CPUPID_WIDTH LAST_CPUPID_SHIFT
 #else
 #define LAST_CPUPID_WIDTH 0
@@ -102,7 +108,7 @@
 #endif
 
 #if ZONES_WIDTH + LRU_GEN_WIDTH + SECTIONS_WIDTH + NODES_WIDTH + \
-	KASAN_TAG_WIDTH + LAST_CPUPID_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
+	KASAN_TAG_WIDTH + ALLOC_TAG_REF_WIDTH + LAST_CPUPID_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
 #error "Not enough bits in page flags"
 #endif
 
include/linux/pgalloc_tag.h +48 -0

60 lines not on this page · raw message

lib/Kconfig.debug +25 -2
index 253f9c2028da..9fc8c1981f27 100644
@@ -979,7 +979,7 @@ config MEM_ALLOC_PROFILING
 	depends on PROC_FS
 	depends on !DEBUG_FORCE_WEAK_PER_CPU
 	select CODE_TAGGING
-	select PAGE_EXTENSION
+	select PAGE_EXTENSION if !PGALLOC_TAG_USE_PAGEFLAGS
 	select SLAB_OBJ_EXT
 	help
 	  Track allocation source code and record total allocation size
@@ -1000,10 +1000,26 @@ config MEM_ALLOC_PROFILING_DEBUG
 	  Adds warnings with helpful error messages for memory allocation
 	  profiling.
 
+config PGALLOC_TAG_USE_PAGEFLAGS
+	bool "Use pageflags to encode page allocation tag reference"
+	default n
+	depends on MEM_ALLOC_PROFILING
+	help
+	  When set, page allocation tag references are encoded inside page
+	  flags, otherwise they are encoded in page extensions.
+
+	  Setting this flag reduces memory and performance overhead of memory
+	  allocation profiling but also limits how many allocations can be
+	  tagged. The number of bits is set by PGALLOC_TAG_USE_PAGEFLAGS and
+	  they must fit in the page flags field.
+
+	  Say N if unsure.
+
 config PGALLOC_TAG_REF_BITS
 	int "Number of bits for page allocation tag reference (10-64)"
 	range 10 64
-	default "64"
+	default "16" if PGALLOC_TAG_USE_PAGEFLAGS
+	default "64" if !PGALLOC_TAG_USE_PAGEFLAGS
 	depends on MEM_ALLOC_PROFILING
 	help
 	  Number of bits used to encode a page allocation tag reference.
@@ -1011,6 +1027,13 @@ config PGALLOC_TAG_REF_BITS
 	  Smaller number results in less memory overhead but limits the number of
 	  allocations which can be tagged (including allocations from modules).
 
+	  If PGALLOC_TAG_USE_PAGEFLAGS is set, the number of requested bits should
+	  fit inside the page flags.
+
+	  If PGALLOC_TAG_USE_PAGEFLAGS is not set, the number of bits used to store
+	  a reference is rounded up to the closest basic type. If set higher than 32,
+	  a direct pointer to the allocation tag is stored for performance reasons.
+
 source "lib/Kconfig.kasan"
 source "lib/Kconfig.kfence"
 source "lib/Kconfig.kmsan"
lib/alloc_tag.c +4 -0
index 73791aa55ab6..34820650186d 100644
@@ -476,6 +476,8 @@ static int __init setup_early_mem_profiling(char *str)
 }
 early_param("sysctl.vm.mem_profiling", setup_early_mem_profiling);
 
+#ifndef CONFIG_PGALLOC_TAG_USE_PAGEFLAGS
+
 static __init bool need_page_alloc_tagging(void)
 {
 	return mem_profiling_support;
@@ -492,6 +494,8 @@ struct page_ext_operations page_alloc_tagging_ops = {
 };
 EXPORT_SYMBOL(page_alloc_tagging_ops);
 
+#endif /* CONFIG_PGALLOC_TAG_USE_PAGEFLAGS */
+
 #ifdef CONFIG_SYSCTL
 static struct ctl_table memory_allocation_profiling_sysctls[] = {
 	{
mm/page_ext.c +1 -1
index 641d93f6af4c..5f993c271ee7 100644
@@ -83,7 +83,7 @@ static struct page_ext_operations *page_ext_ops[] __initdata = {
 #if defined(CONFIG_PAGE_IDLE_FLAG) && !defined(CONFIG_64BIT)
 	&page_idle_ops,
 #endif
-#ifdef CONFIG_MEM_ALLOC_PROFILING
+#if defined(CONFIG_MEM_ALLOC_PROFILING) && !defined(CONFIG_PGALLOC_TAG_USE_PAGEFLAGS)
 	&page_alloc_tagging_ops,
 #endif
 #ifdef CONFIG_PAGE_TABLE_CHECK
Signature · 1 line
2.46.0.469.g59c65b2a67-goog
maintainer
#13 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

Quoted 14 lines · On Sun, 1 Sep 2024 21:41:28 -0700 Suren Baghdasaryan <[email protected]> wrote:

Add CONFIG_PGALLOC_TAG_USE_PAGEFLAGS to store allocation tag references directly in the page flags. This removes dependency on page_ext and results in better performance for page allocations as well as reduced page_ext memory overhead. CONFIG_PGALLOC_TAG_REF_BITS controls the number of bits required to be available in the page flags to store the references. If the number of page flag bits is insufficient, the build will fail and either CONFIG_PGALLOC_TAG_REF_BITS would have to be lowered or CONFIG_PGALLOC_TAG_USE_PAGEFLAGS should be disabled.

...

lib/Kconfig.debug +2 -0
+config PGALLOC_TAG_USE_PAGEFLAGS
+	bool "Use pageflags to encode page allocation tag reference"

lib/Kconfig.debug config MEM_ALLOC_PROFILING_DEBUG · line 1014

Quoted 10 lines
lib/Kconfig.debug +10 -0
+	default n
+	depends on MEM_ALLOC_PROFILING
+	help
+	  When set, page allocation tag references are encoded inside page
+	  flags, otherwise they are encoded in page extensions.
+
+	  Setting this flag reduces memory and performance overhead of memory
+	  allocation profiling but also limits how many allocations can be
+	  tagged. The number of bits is set by PGALLOC_TAG_USE_PAGEFLAGS and
+	  they must fit in the page flags field.

Again. Please put yourself in the position of one of the all-minus-two people in this world who aren't kernel-memory-profiling-developers. How the heck are they to decide whether or not to enable this? OK, 59% of them are likely to say "yes" because reasons. But then what? How are they to determine whether it was the correct choice for them? If we don't tell them, who will?

Quoted 10 lines

config PGALLOC_TAG_REF_BITS

lib/Kconfig.debug +2 -1
 	int "Number of bits for page allocation tag reference (10-64)"
 	range 10 64
-	default "64"
+	default "16" if PGALLOC_TAG_USE_PAGEFLAGS
+	default "64" if !PGALLOC_TAG_USE_PAGEFLAGS
 	depends on MEM_ALLOC_PROFILING
 	help
 	  Number of bits used to encode a page allocation tag reference.

lib/Kconfig.debug config PGALLOC_TAG_REF_BITS · line 1031

Quoted 5 lines
lib/Kconfig.debug +2 -0
@@ -1011,6 +1027,13 @@ config PGALLOC_TAG_REF_BITS
 	  Smaller number results in less memory overhead but limits the number of
 	  allocations which can be tagged (including allocations from modules).
 
+	  If PGALLOC_TAG_USE_PAGEFLAGS is set, the number of requested bits should
+	  fit inside the page flags.

What does "should fit" mean? "It is your responsibility to make it fit"? "We think it will fit but we aren't really sure"?

lib/Kconfig.debug config PGALLOC_TAG_REF_BITS · line 1036

Quoted 4 lines
lib/Kconfig.debug +4 -0
+	  If PGALLOC_TAG_USE_PAGEFLAGS is not set, the number of bits used to store
+	  a reference is rounded up to the closest basic type. If set higher than 32,
+	  a direct pointer to the allocation tag is stored for performance reasons.
+

We shouldn't be offering things like this to our users. If we cannot decide, how can they?

author maintainer
#14 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

Quoted 26 lines · Andrew Morton
Quoted 23 lines · On Sun, 1 Sep 2024 21:41:28 -0700 Suren Baghdasaryan <[email protected]> wrote:

Add CONFIG_PGALLOC_TAG_USE_PAGEFLAGS to store allocation tag references directly in the page flags. This removes dependency on page_ext and results in better performance for page allocations as well as reduced page_ext memory overhead. CONFIG_PGALLOC_TAG_REF_BITS controls the number of bits required to be available in the page flags to store the references. If the number of page flag bits is insufficient, the build will fail and either CONFIG_PGALLOC_TAG_REF_BITS would have to be lowered or CONFIG_PGALLOC_TAG_USE_PAGEFLAGS should be disabled.

...

lib/Kconfig.debug +11 -0
+config PGALLOC_TAG_USE_PAGEFLAGS
+     bool "Use pageflags to encode page allocation tag reference"
+     default n
+     depends on MEM_ALLOC_PROFILING
+     help
+       When set, page allocation tag references are encoded inside page
+       flags, otherwise they are encoded in page extensions.
+
+       Setting this flag reduces memory and performance overhead of memory
+       allocation profiling but also limits how many allocations can be
+       tagged. The number of bits is set by PGALLOC_TAG_USE_PAGEFLAGS and
Quoted 8 lines
Quoted 1 line

+ they must fit in the page flags field.

Again. Please put yourself in the position of one of the all-minus-two people in this world who aren't kernel-memory-profiling-developers. How the heck are they to decide whether or not to enable this? OK, 59% of them are likely to say "yes" because reasons. But then what? How are they to determine whether it was the correct choice for them? If we don't tell them, who will?

Fair point. I think one would want to enable this config unless there aren't enough unused bits if the page flags to address all page allocation tags. That last part of determining how many bits we need is a bit tricky.
If we put aside loadable modules for now, there are 3 cases:

1. The number of unused page flag bits is enough to address all page allocations.
2. The number of unused page flag bits is enough if we push last_cpupid out of page flags. In that case we get the warning at
https://elixir.bootlin.com/linux/v6.11-rc6/source/mm/mm_init.c#L124.
3. The number of unused page flag bits is not enough even if we push last_cpupid out of page flags. In that case we get the "Not enough bits in page flags" build time error.

So, maybe I should make this option "default y" when CONFIG_MEM_ALLOC_PROFILING=y and let the user disable it if they hit case #3 or (case #2 and performance hit is unacceptable)?

For loadable modules, if we hit the limit when loading a module at runtime, we could issue a warning and disable allocation tagging via the static key. Another option is to fail to load the module with a proper warning but that IMO would be less appealing.

Quoted 14 lines
Quoted 14 lines

config PGALLOC_TAG_REF_BITS
int "Number of bits for page allocation tag reference (10-64)" range 10 64

lib/Kconfig.debug +2 -1
-     default "64"
+     default "16" if PGALLOC_TAG_USE_PAGEFLAGS
+     default "64" if !PGALLOC_TAG_USE_PAGEFLAGS
      depends on MEM_ALLOC_PROFILING
      help
        Number of bits used to encode a page allocation tag reference.
@@ -1011,6 +1027,13 @@ config PGALLOC_TAG_REF_BITS
        Smaller number results in less memory overhead but limits the number of
        allocations which can be tagged (including allocations from modules).
 
Quoted 5 lines

lib/Kconfig.debug config PGALLOC_TAG_REF_BITS · line 1031

Quoted 2 lines
lib/Kconfig.debug +2 -0
+       If PGALLOC_TAG_USE_PAGEFLAGS is set, the number of requested bits should
+       fit inside the page flags.

What does "should fit" mean? "It is your responsibility to make it fit"? "We think it will fit but we aren't really sure"?

This is the case #3 I described above, the user will get a "Not enough bits in page flags" build time error. If we stick with this config, I can clarify that in this description.

Quoted 8 lines

lib/Kconfig.debug config PGALLOC_TAG_REF_BITS · line 1036

Quoted 5 lines
lib/Kconfig.debug +4 -0
+       If PGALLOC_TAG_USE_PAGEFLAGS is not set, the number of bits used to store
+       a reference is rounded up to the closest basic type. If set higher than 32,
+       a direct pointer to the allocation tag is stored for performance reasons.
+

We shouldn't be offering things like this to our users. If we cannot decide, how can they?

Thinking about the ease of use, the CONFIG_PGALLOC_TAG_REF_BITS is the hardest one to set. The user does not know how many page allocations are there. I think I can simplify this by trying to use all unused page flag bits for addressing the tags. Then, after compilation we can follow the rules I mentioned before:
- If the available bits are not enough to address all kernel page allocations, we issue an error. The user should disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS.
- If there are enough unused bits but we have to push last_cpupid out of page flags, we issue a warning and continue. The user can disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS if last_cpupid has to stay in page flags.
- If we run out of addressing space during module loading, we disable allocation tagging and continue. The user should disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS.

This leaves one outstanding case:
- If we run out of addressing space during module loading but we would not run out of space if we pushed last_cpupid out of page flags during compilation.
In this case I would want the user to have an option to request a larger addressing space for page allocation tags at compile time. Maybe I can keep CONFIG_PGALLOC_TAG_REF_BITS for such explicit requests for a larger space? This would limit the use of CONFIG_PGALLOC_TAG_REF_BITS to this case only. In all other cases the number of bits would be set automatically. WDYT?

#15 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

Quoted 2 lines · Suren Baghdasaryan
Quoted 1 line · Andrew Morton

On Sun, 1 Sep 2024 21:41:28 -0700 Suren Baghdasaryan <[email protected]> wrote:

...

Quoted 18 lines
Quoted 2 lines

We shouldn't be offering things like this to our users. If we cannot decide, how can they?

Thinking about the ease of use, the CONFIG_PGALLOC_TAG_REF_BITS is the hardest one to set. The user does not know how many page allocations are there. I think I can simplify this by trying to use all unused page flag bits for addressing the tags. Then, after compilation we can follow the rules I mentioned before:
- If the available bits are not enough to address all kernel page allocations, we issue an error. The user should disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS.
- If there are enough unused bits but we have to push last_cpupid out of page flags, we issue a warning and continue. The user can disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS if last_cpupid has to stay in page flags.
- If we run out of addressing space during module loading, we disable allocation tagging and continue. The user should disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS.

If the computer already knows what to do, it should do it, rather than prompting the user to disable a deeply mystifying config parameter.

Quoted 11 lines

This leaves one outstanding case:
- If we run out of addressing space during module loading but we would not run out of space if we pushed last_cpupid out of page flags during compilation.
In this case I would want the user to have an option to request a larger addressing space for page allocation tags at compile time. Maybe I can keep CONFIG_PGALLOC_TAG_REF_BITS for such explicit requests for a larger space? This would limit the use of CONFIG_PGALLOC_TAG_REF_BITS to this case only. In all other cases the number of bits would be set automatically. WDYT?

Manually dealing with something like this is just not going to work.

The more I read this story, the clearer it becomes that this should be entirely done by the build system: set it, or don't set it, automatically.

And if you can make it not even a kconfig item at all, that's probably even better.

And if there is no way to set it automatically, then that probably means that the feature is still too raw to unleash upon the world.

thanks,

Signature · 2 lines
John Hubbard
NVIDIA
#16 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

Quoted 9 lines · John Hubbard
Quoted 2 lines · Suren Baghdasaryan
Quoted 1 line · Andrew Morton

On Sun,  1 Sep 2024 21:41:28 -0700 Suren Baghdasaryan <[email protected]> wrote:

...

Quoted 5 lines
Quoted 2 lines

We shouldn't be offering things like this to our users.  If we cannot decide, how can they?

Thinking about the ease of use, the CONFIG_PGALLOC_TAG_REF_BITS is the hardest one to set. The user does not know how many page allocations

I should probably clarify my previous reply, so here is the more detailed version:

Quoted 2 lines
Quoted 2 lines

are there. I think I can simplify this by trying to use all unused page flag bits for addressing the tags. Then, after compilation we can

Yes.

Quoted 4 lines
Quoted 4 lines

follow the rules I mentioned before:
- If the available bits are not enough to address all kernel page allocations, we issue an error. The user should disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS.

The configuration should disable itself, in this case. But if that is too big of a change for now, I suppose we could fall back to an error message to the effect of, "please disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS because the kernel build system is still too primitive to do that for you". :)

Quoted 4 lines
Quoted 4 lines

- If there are enough unused bits but we have to push last_cpupid out of page flags, we issue a warning and continue. The user can disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS if last_cpupid has to stay in page flags.

Let's try to decide now, what that tradeoff should be. Just pick one based on what some of us perceive to be the expected usefulness and frequency of use between last_cpuid and these tag refs.

If someone really needs to change the tradeoff for that one bit, then that someone is also likely able to hack up a change for it.

thanks,

Signature · 1 line
John Hubbard
Quoted 31 lines
Quoted 3 lines

- If we run out of addressing space during module loading, we disable allocation tagging and continue. The user should disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS.

If the computer already knows what to do, it should do it, rather than prompting the user to disable a deeply mystifying config parameter.

Quoted 11 lines

This leaves one outstanding case:
- If we run out of addressing space during module loading but we would not run out of space if we pushed last_cpupid out of page flags during compilation.
In this case I would want the user to have an option to request a larger addressing space for page allocation tags at compile time. Maybe I can keep CONFIG_PGALLOC_TAG_REF_BITS for such explicit requests for a larger space? This would limit the use of CONFIG_PGALLOC_TAG_REF_BITS to this case only. In all other cases the number of bits would be set automatically. WDYT?

Manually dealing with something like this is just not going to work.

The more I read this story, the clearer it becomes that this should be entirely done by the build system: set it, or don't set it, automatically.

And if you can make it not even a kconfig item at all, that's probably even better.

And if there is no way to set it automatically, then that probably means that the feature is still too raw to unleash upon the world.

thanks,

author maintainer
#17 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

Quoted 25 lines · John Hubbard' via kernel-team
Quoted 9 lines · John Hubbard
Quoted 2 lines · Suren Baghdasaryan
Quoted 1 line · Andrew Morton

On Sun, 1 Sep 2024 21:41:28 -0700 Suren Baghdasaryan <[email protected]> wrote:

...

Quoted 5 lines
Quoted 2 lines

We shouldn't be offering things like this to our users. If we cannot decide, how can they?

Thinking about the ease of use, the CONFIG_PGALLOC_TAG_REF_BITS is the hardest one to set. The user does not know how many page allocations

I should probably clarify my previous reply, so here is the more detailed version:

Quoted 2 lines
Quoted 2 lines

are there. I think I can simplify this by trying to use all unused page flag bits for addressing the tags. Then, after compilation we can

Yes.

Quoted 4 lines
Quoted 4 lines

follow the rules I mentioned before:
- If the available bits are not enough to address all kernel page allocations, we issue an error. The user should disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS.

Quoted 4 lines

The configuration should disable itself, in this case. But if that is too big of a change for now, I suppose we could fall back to an error message to the effect of, "please disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS because the kernel build system is still too primitive to do that for you". :)

I don't think we can detect this at build time. We need to know how many page allocations there are, which we find out only after we build the kernel image (from the section size that holds allocation tags). Therefore it would have to be a post-build check. So I think the best we can do is to generate the error like the one you suggested after we build the image.
Dependency on CONFIG_PAGE_EXTENSION is yet another complexity because if we auto-disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS, we would have to also auto-enable CONFIG_PAGE_EXTENSION if it's not already enabled.

I'll dig around some more to see if there is a better way.

Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

- If there are enough unused bits but we have to push last_cpupid out of page flags, we issue a warning and continue. The user can disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS if last_cpupid has to stay in page flags.

Quoted 6 lines

Let's try to decide now, what that tradeoff should be. Just pick one based on what some of us perceive to be the expected usefulness and frequency of use between last_cpuid and these tag refs.

If someone really needs to change the tradeoff for that one bit, then that someone is also likely able to hack up a change for it.

Yeah, from all the feedback, I realize that by pursuing the maximum flexibility I made configuring this mechanism close to impossible. I think the first step towards simplifying this would be to identify usable configurations. From that POV, I can see 3 useful modes:

1. Page flags are not used. In this mode we will use direct pointer references and page extensions, like we do today. This mode is used when we don't have enough page flags. This can be a safe default which keeps things as they are today and should always work.
2. Page flags are used but not forced. This means we will try to use all free page flags bits (up to a reasonable limit of 16) without pushing out last_cpupid.
3. Page flags are forced. This means we will try to use all free page flags bits after pushing last_cpupid out of page flags. This mode could be used if the user cares about memory profiling more than the performance overhead caused by last_cpupid.

I'm not 100% sure (3) is needed, so I think we can skip it until someone asks for it. It should be easy to add that in the future. If we detect at build time that we don't have enough page flag bits to cover kernel allocations for modes (2) or (3), we issue an error prompting the user to reconfigure to mode (1).

Ideally, I would like to have (2) as default mode and automatically fall back to (1) when it's impossible but as I mentioned before, I don't yet see a way to do that automatically.

For loadable modules, I think my earlier suggestion should work fine. If a module causes us to run out of space for tags, we disable memory profiling at runtime and log a warning for the user stating that we disabled memory profiling and if the user needs it they should configure mode (1). I *think* I can even disable profiling only for that module and not globally but I need to try that first.

I can start with modes (1) and (2) support which requires only CONFIG_PGALLOC_TAG_USE_PAGEFLAGS defaulted to N. Any user can try enabling this config and if that builds fine then keeping it for better performance and memory usage. Does that sound acceptable? Thanks,
Suren.

Quoted 41 lines

thanks,
--
John Hubbard

Quoted 24 lines
Quoted 3 lines

- If we run out of addressing space during module loading, we disable allocation tagging and continue. The user should disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS.

If the computer already knows what to do, it should do it, rather than prompting the user to disable a deeply mystifying config parameter.

Quoted 11 lines

This leaves one outstanding case:
- If we run out of addressing space during module loading but we would not run out of space if we pushed last_cpupid out of page flags during compilation.
In this case I would want the user to have an option to request a larger addressing space for page allocation tags at compile time. Maybe I can keep CONFIG_PGALLOC_TAG_REF_BITS for such explicit requests for a larger space? This would limit the use of CONFIG_PGALLOC_TAG_REF_BITS to this case only. In all other cases the number of bits would be set automatically. WDYT?

Manually dealing with something like this is just not going to work.

The more I read this story, the clearer it becomes that this should be entirely done by the build system: set it, or don't set it, automatically.

Quoted 7 lines

And if you can make it not even a kconfig item at all, that's probably even better.

And if there is no way to set it automatically, then that probably means that the feature is still too raw to unleash upon the world.

thanks,

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

#18 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

Quoted 6 lines · Suren Baghdasaryan
Quoted 4 lines · John Hubbard' via kernel-team
Quoted 3 lines · John Hubbard
Quoted 2 lines · Suren Baghdasaryan
Quoted 1 line · Andrew Morton

On Sun, 1 Sep 2024 21:41:28 -0700 Suren Baghdasaryan <[email protected]> wrote:

...

Quoted 34 lines
Quoted 4 lines

The configuration should disable itself, in this case. But if that is too big of a change for now, I suppose we could fall back to an error message to the effect of, "please disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS because the kernel build system is still too primitive to do that for you". :)

I don't think we can detect this at build time. We need to know how many page allocations there are, which we find out only after we build the kernel image (from the section size that holds allocation tags). Therefore it would have to be a post-build check. So I think the best we can do is to generate the error like the one you suggested after we build the image.
Dependency on CONFIG_PAGE_EXTENSION is yet another complexity because if we auto-disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS, we would have to also auto-enable CONFIG_PAGE_EXTENSION if it's not already enabled.

I'll dig around some more to see if there is a better way.

Quoted 6 lines
Quoted 5 lines
Quoted 5 lines

- If there are enough unused bits but we have to push last_cpupid out of page flags, we issue a warning and continue. The user can disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS if last_cpupid has to stay in page flags.

Quoted 6 lines

Let's try to decide now, what that tradeoff should be. Just pick one based on what some of us perceive to be the expected usefulness and frequency of use between last_cpuid and these tag refs.

If someone really needs to change the tradeoff for that one bit, then that someone is also likely able to hack up a change for it.

Yeah, from all the feedback, I realize that by pursuing the maximum flexibility I made configuring this mechanism close to impossible. I think the first step towards simplifying this would be to identify usable configurations. From that POV, I can see 3 useful modes:

Quoted 4 lines

1. Page flags are not used. In this mode we will use direct pointer references and page extensions, like we do today. This mode is used when we don't have enough page flags. This can be a safe default which keeps things as they are today and should always work.

Definitely my favorite so far.

Quoted 3 lines

2. Page flags are used but not forced. This means we will try to use all free page flags bits (up to a reasonable limit of 16) without pushing out last_cpupid.

This is a logical next step, agreed.

Quoted 7 lines

3. Page flags are forced. This means we will try to use all free page flags bits after pushing last_cpupid out of page flags. This mode could be used if the user cares about memory profiling more than the performance overhead caused by last_cpupid.

I'm not 100% sure (3) is needed, so I think we can skip it until someone asks for it. It should be easy to add that in the future.

Right.

Quoted 15 lines

If we detect at build time that we don't have enough page flag bits to cover kernel allocations for modes (2) or (3), we issue an error prompting the user to reconfigure to mode (1).

Ideally, I would like to have (2) as default mode and automatically fall back to (1) when it's impossible but as I mentioned before, I don't yet see a way to do that automatically.

For loadable modules, I think my earlier suggestion should work fine. If a module causes us to run out of space for tags, we disable memory profiling at runtime and log a warning for the user stating that we disabled memory profiling and if the user needs it they should configure mode (1). I *think* I can even disable profiling only for that module and not globally but I need to try that first.

Quoted 7 lines

I can start with modes (1) and (2) support which requires only CONFIG_PGALLOC_TAG_USE_PAGEFLAGS defaulted to N. Any user can try enabling this config and if that builds fine then keeping it for better performance and memory usage. Does that sound acceptable? Thanks,
Suren.

How badly do we need (2)? Because this is really expensive:

a) It adds complexity to a complex,delicate core part of mm.

b) It adds constraints, which prevent possible future features.

It's not yet clear that (2) is valuable enough (compared to (1)) to compensate, at least from what I've read. Unless I missed something big.

thanks,

Signature · 1 line
John Hubbard
author maintainer
#19 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

Quoted 91 lines · John Hubbard' via kernel-team
Quoted 6 lines · Suren Baghdasaryan
Quoted 4 lines · John Hubbard' via kernel-team
Quoted 3 lines · John Hubbard
Quoted 2 lines · Suren Baghdasaryan
Quoted 1 line · Andrew Morton

On Sun, 1 Sep 2024 21:41:28 -0700 Suren Baghdasaryan <[email protected]> wrote:

...

Quoted 34 lines
Quoted 4 lines

The configuration should disable itself, in this case. But if that is too big of a change for now, I suppose we could fall back to an error message to the effect of, "please disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS because the kernel build system is still too primitive to do that for you". :)

I don't think we can detect this at build time. We need to know how many page allocations there are, which we find out only after we build the kernel image (from the section size that holds allocation tags). Therefore it would have to be a post-build check. So I think the best we can do is to generate the error like the one you suggested after we build the image.
Dependency on CONFIG_PAGE_EXTENSION is yet another complexity because if we auto-disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS, we would have to also auto-enable CONFIG_PAGE_EXTENSION if it's not already enabled.

I'll dig around some more to see if there is a better way.

Quoted 6 lines
Quoted 5 lines
Quoted 5 lines

- If there are enough unused bits but we have to push last_cpupid out of page flags, we issue a warning and continue. The user can disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS if last_cpupid has to stay in page flags.

Quoted 6 lines

Let's try to decide now, what that tradeoff should be. Just pick one based on what some of us perceive to be the expected usefulness and frequency of use between last_cpuid and these tag refs.

If someone really needs to change the tradeoff for that one bit, then that someone is also likely able to hack up a change for it.

Yeah, from all the feedback, I realize that by pursuing the maximum flexibility I made configuring this mechanism close to impossible. I think the first step towards simplifying this would be to identify usable configurations. From that POV, I can see 3 useful modes:

Quoted 4 lines

1. Page flags are not used. In this mode we will use direct pointer references and page extensions, like we do today. This mode is used when we don't have enough page flags. This can be a safe default which keeps things as they are today and should always work.

Definitely my favorite so far.

Quoted 3 lines

2. Page flags are used but not forced. This means we will try to use all free page flags bits (up to a reasonable limit of 16) without pushing out last_cpupid.

This is a logical next step, agreed.

Quoted 7 lines

3. Page flags are forced. This means we will try to use all free page flags bits after pushing last_cpupid out of page flags. This mode could be used if the user cares about memory profiling more than the performance overhead caused by last_cpupid.

I'm not 100% sure (3) is needed, so I think we can skip it until someone asks for it. It should be easy to add that in the future.

Right.

Quoted 15 lines

If we detect at build time that we don't have enough page flag bits to cover kernel allocations for modes (2) or (3), we issue an error prompting the user to reconfigure to mode (1).

Ideally, I would like to have (2) as default mode and automatically fall back to (1) when it's impossible but as I mentioned before, I don't yet see a way to do that automatically.

For loadable modules, I think my earlier suggestion should work fine. If a module causes us to run out of space for tags, we disable memory profiling at runtime and log a warning for the user stating that we disabled memory profiling and if the user needs it they should configure mode (1). I *think* I can even disable profiling only for that module and not globally but I need to try that first.

Quoted 7 lines

I can start with modes (1) and (2) support which requires only CONFIG_PGALLOC_TAG_USE_PAGEFLAGS defaulted to N. Any user can try enabling this config and if that builds fine then keeping it for better performance and memory usage. Does that sound acceptable? Thanks,
Suren.

How badly do we need (2)? Because this is really expensive:

Quoted 7 lines

a) It adds complexity to a complex,delicate core part of mm.

b) It adds constraints, which prevent possible future features.

It's not yet clear that (2) is valuable enough (compared to (1)) to compensate, at least from what I've read. Unless I missed something big.

(1) is what we already have today.
(2) would allow us to drop page_ext dependency, so there is considerable memory saving and performance improvement (no need to lookup the page extension on each tag reference). The benefits are described in the cover letter at:
https://lore.kernel.org/all/[email protected]/.

Quoted 8 lines

thanks,
--
John Hubbard

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

#20 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

In reply to John Hubbard
Quoted 8 lines · John Hubbard

The more I read this story, the clearer it becomes that this should be entirely done by the build system: set it, or don't set it, automatically.

And if you can make it not even a kconfig item at all, that's probably even better.

And if there is no way to set it automatically, then that probably means that the feature is still too raw to unleash upon the world.

I'd suggest that this implementation is just too whack.

What if you use a maple tree for this? For each allocation range, you can store a pointer to a tag instead of storing an index in each folio.

author maintainer
#21 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

Quoted 8 lines · Matthew Wilcox
Quoted 6 lines · John Hubbard

The more I read this story, the clearer it becomes that this should be entirely done by the build system: set it, or don't set it, automatically.

And if you can make it not even a kconfig item at all, that's probably even better.

Quoted 7 lines
Quoted 2 lines

And if there is no way to set it automatically, then that probably means that the feature is still too raw to unleash upon the world.

I'd suggest that this implementation is just too whack.

What if you use a maple tree for this? For each allocation range, you can store a pointer to a tag instead of storing an index in each folio.

I'm not sure I understand your suggestion, Matthew. We allocate a folio and need to store a reference to the tag associated with the code that allocated that folio. We are not operating with ranges here. Are you suggesting to use a maple tree instead of page_ext to store this reference?

maintainer
#22 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

Quoted 14 lines · Suren Baghdasaryan
Quoted 13 lines · Matthew Wilcox
Quoted 8 lines · John Hubbard

The more I read this story, the clearer it becomes that this should be entirely done by the build system: set it, or don't set it, automatically.

And if you can make it not even a kconfig item at all, that's probably even better.

And if there is no way to set it automatically, then that probably means that the feature is still too raw to unleash upon the world.

I'd suggest that this implementation is just too whack.

Quoted 8 lines
Quoted 2 lines

What if you use a maple tree for this? For each allocation range, you can store a pointer to a tag instead of storing an index in each folio.

I'm not sure I understand your suggestion, Matthew. We allocate a folio and need to store a reference to the tag associated with the code that allocated that folio. We are not operating with ranges here. Are you suggesting to use a maple tree instead of page_ext to store this reference?

yeah, I don't think the maple tree idea makes any sense either

we already have a way of going from index -> alloc tag, this is just about how we store the index

#23 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

In reply to Suren Baghdasaryan
Quoted 5 lines · Suren Baghdasaryan

I'm not sure I understand your suggestion, Matthew. We allocate a folio and need to store a reference to the tag associated with the code that allocated that folio. We are not operating with ranges here. Are you suggesting to use a maple tree instead of page_ext to store this reference?

I'm saying that a folio has a physical address. So you can use a physical address as an index into a maple tree to store additional information instead of using page_ext or trying to hammer the additional information into struct page somewhere.

maintainer
#24 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

Quoted 11 lines · Matthew Wilcox
Quoted 5 lines · Suren Baghdasaryan

I'm not sure I understand your suggestion, Matthew. We allocate a folio and need to store a reference to the tag associated with the code that allocated that folio. We are not operating with ranges here. Are you suggesting to use a maple tree instead of page_ext to store this reference?

I'm saying that a folio has a physical address. So you can use a physical address as an index into a maple tree to store additional information instead of using page_ext or trying to hammer the additional information into struct page somewhere.

Ah, thanks, that makes more sense.

But it would add a lot of overhead to the page alloc/free paths...

author maintainer
#25 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

Quoted 9 lines · Kent Overstreet
Quoted 7 lines · Matthew Wilcox
Quoted 5 lines · Suren Baghdasaryan

I'm not sure I understand your suggestion, Matthew. We allocate a folio and need to store a reference to the tag associated with the code that allocated that folio. We are not operating with ranges here. Are you suggesting to use a maple tree instead of page_ext to store this reference?

Quoted 8 lines
Quoted 4 lines

I'm saying that a folio has a physical address. So you can use a physical address as an index into a maple tree to store additional information instead of using page_ext or trying to hammer the additional information into struct page somewhere.

Ah, thanks, that makes more sense.

But it would add a lot of overhead to the page alloc/free paths...

Yeah, inserting into a maple_tree in the fast path of page allocation would introduce considerable performance overhead.

maintainer
#26 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

In reply to John Hubbard
Quoted 38 lines · John Hubbard
Quoted 2 lines · Suren Baghdasaryan
Quoted 1 line · Andrew Morton

On Sun, 1 Sep 2024 21:41:28 -0700 Suren Baghdasaryan <[email protected]> wrote:

...

Quoted 18 lines
Quoted 2 lines

We shouldn't be offering things like this to our users. If we cannot decide, how can they?

Thinking about the ease of use, the CONFIG_PGALLOC_TAG_REF_BITS is the hardest one to set. The user does not know how many page allocations are there. I think I can simplify this by trying to use all unused page flag bits for addressing the tags. Then, after compilation we can follow the rules I mentioned before:
- If the available bits are not enough to address all kernel page allocations, we issue an error. The user should disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS.
- If there are enough unused bits but we have to push last_cpupid out of page flags, we issue a warning and continue. The user can disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS if last_cpupid has to stay in page flags.
- If we run out of addressing space during module loading, we disable allocation tagging and continue. The user should disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS.

If the computer already knows what to do, it should do it, rather than prompting the user to disable a deeply mystifying config parameter.

Quoted 11 lines

This leaves one outstanding case:
- If we run out of addressing space during module loading but we would not run out of space if we pushed last_cpupid out of page flags during compilation.
In this case I would want the user to have an option to request a larger addressing space for page allocation tags at compile time. Maybe I can keep CONFIG_PGALLOC_TAG_REF_BITS for such explicit requests for a larger space? This would limit the use of CONFIG_PGALLOC_TAG_REF_BITS to this case only. In all other cases the number of bits would be set automatically. WDYT?

Quoted 4 lines

Manually dealing with something like this is just not going to work.

The more I read this story, the clearer it becomes that this should be entirely done by the build system: set it, or don't set it, automatically.

The difficulty is that we don't know how many modules are going to be loaded, and an allyesconfig or allmodconfig is going to require quite a few bits - it's not something we can really predict or calculate.

So there is some genuine trickyness here.

#27 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

In reply to Suren Baghdasaryan
kernel test robot noticed the following build errors:

Hi Suren,

kernel test robot noticed the following build errors:

[auto build test ERROR on 18d35b7e30d5a217ff1cc976bb819e1aa2873301]

url:    https://github.com/intel-lab-lkp/linux/commits/Suren-Baghdasaryan/maple_tree-add-mas_for_each_rev-helper/20240902-124322
base:   18d35b7e30d5a217ff1cc976bb819e1aa2873301
patch link:    https://lore.kernel.org/r/20240902044128.664075-7-surenb%40google.com
patch subject: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags
config: hexagon-randconfig-r113-20240903 (https://download.01.org/0day-ci/archive/20240903/[email protected]/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project dc19b59ea2502193c0e7bc16bb7d711c8053edcf)
reproduce: (https://download.01.org/0day-ci/archive/20240903/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from arch/hexagon/kernel/asm-offsets.c:12:
In file included from include/linux/compat.h:15:
In file included from include/linux/socket.h:8:
In file included from include/linux/uio.h:10:
In file included from include/linux/mm_types.h:18:

>> include/linux/page-flags-layout.h:112:2: error: "Not enough bits in page flags"
     112 | #error "Not enough bits in page flags"
         |  ^
   In file included from arch/hexagon/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:17:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:98:11: warning: array index 3 is past the end of the array (that has type 'unsigned long[2]') [-Warray-bounds]
      98 |                 return (set->sig[3] | set->sig[2] |
         |                         ^        ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/hexagon/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:17:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:98:25: warning: array index 2 is past the end of the array (that has type 'unsigned long[2]') [-Warray-bounds]
      98 |                 return (set->sig[3] | set->sig[2] |
         |                                       ^        ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/hexagon/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:17:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:114:11: warning: array index 3 is past the end of the array (that has type 'const unsigned long[2]') [-Warray-bounds]
     114 |                 return  (set1->sig[3] == set2->sig[3]) &&
         |                          ^         ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/hexagon/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:17:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:114:27: warning: array index 3 is past the end of the array (that has type 'const unsigned long[2]') [-Warray-bounds]
     114 |                 return  (set1->sig[3] == set2->sig[3]) &&
         |                                          ^         ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/hexagon/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:17:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:115:5: warning: array index 2 is past the end of the array (that has type 'const unsigned long[2]') [-Warray-bounds]
     115 |                         (set1->sig[2] == set2->sig[2]) &&
         |                          ^         ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/hexagon/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:17:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:115:21: warning: array index 2 is past the end of the array (that has type 'const unsigned long[2]') [-Warray-bounds]
     115 |                         (set1->sig[2] == set2->sig[2]) &&
         |                                          ^         ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/hexagon/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:17:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:157:1: warning: array index 3 is past the end of the array (that has type 'const unsigned long[2]') [-Warray-bounds]
     157 | _SIG_SET_BINOP(sigorsets, _sig_or)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/signal.h:138:8: note: expanded from macro '_SIG_SET_BINOP'
     138 |                 a3 = a->sig[3]; a2 = a->sig[2];                         \
         |                      ^      ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from arch/hexagon/kernel/asm-offsets.c:12:
   In file included from include/linux/compat.h:17:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:157:1: warning: array index 2 is past the end of the array (that has type 'const unsigned long[2]') [-Warray-bounds]
     157 | _SIG_SET_BINOP(sigorsets, _sig_or)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/signal.h:138:24: note: expanded from macro '_SIG_SET_BINOP'
     138 |                 a3 = a->sig[3]; a2 = a->sig[2];                         \

vim +112 include/linux/page-flags-layout.h

bbeae5b05ef6e4 Peter Zijlstra     2013-02-22  109  
ec1c86b25f4bdd Yu Zhao            2022-09-18  110  #if ZONES_WIDTH + LRU_GEN_WIDTH + SECTIONS_WIDTH + NODES_WIDTH + \
11f61468666eee Suren Baghdasaryan 2024-09-01  111  	KASAN_TAG_WIDTH + ALLOC_TAG_REF_WIDTH + LAST_CPUPID_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
1587db62d8c0db Yu Zhao            2021-04-29 @112  #error "Not enough bits in page flags"
75980e97daccfc Peter Zijlstra     2013-02-22  113  #endif
75980e97daccfc Peter Zijlstra     2013-02-22  114  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#28 lore raw

Re: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags

In reply to Suren Baghdasaryan
kernel test robot noticed the following build errors:

Hi Suren,

kernel test robot noticed the following build errors:

[auto build test ERROR on 18d35b7e30d5a217ff1cc976bb819e1aa2873301]

url:    https://github.com/intel-lab-lkp/linux/commits/Suren-Baghdasaryan/maple_tree-add-mas_for_each_rev-helper/20240902-124322
base:   18d35b7e30d5a217ff1cc976bb819e1aa2873301
patch link:    https://lore.kernel.org/r/20240902044128.664075-7-surenb%40google.com
patch subject: [PATCH v2 6/6] alloc_tag: config to store page allocation tag refs in page flags
config: m68k-randconfig-r131-20240903 (https://download.01.org/0day-ci/archive/20240903/[email protected]/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce: (https://download.01.org/0day-ci/archive/20240903/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from include/linux/mmzone.h:20,

                    from include/linux/topology.h:33,
                    from include/linux/irq.h:19,
                    from include/asm-generic/hardirq.h:17,
                    from ./arch/m68k/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:11,
                    from include/linux/interrupt.h:11,
                    from include/linux/kernel_stat.h:8,
                    from arch/m68k/kernel/asm-offsets.c:16:
>> include/linux/page-flags-layout.h:112:2: error: #error "Not enough bits in page flags"

112 | #error "Not enough bits in page flags"
| ^~~~~
make[3]: *** [scripts/Makefile.build:117: arch/m68k/kernel/asm-offsets.s] Error 1 make[3]: Target 'prepare' not remade because of errors.
make[2]: *** [Makefile:1193: prepare0] Error 2
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:224: __sub-make] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:224: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.

vim +112 include/linux/page-flags-layout.h

bbeae5b05ef6e4 Peter Zijlstra     2013-02-22  109  
ec1c86b25f4bdd Yu Zhao            2022-09-18  110  #if ZONES_WIDTH + LRU_GEN_WIDTH + SECTIONS_WIDTH + NODES_WIDTH + \
11f61468666eee Suren Baghdasaryan 2024-09-01  111  	KASAN_TAG_WIDTH + ALLOC_TAG_REF_WIDTH + LAST_CPUPID_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
1587db62d8c0db Yu Zhao            2021-04-29 @112  #error "Not enough bits in page flags"
75980e97daccfc Peter Zijlstra     2013-02-22  113  #endif
75980e97daccfc Peter Zijlstra     2013-02-22  114  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki