Skip to contentSkip to conversation

mm-slub-move-sysfs-slab-alloc-free-interfaces-to-debugfs.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jul 6, 2021

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm: slub: move sysfs slab alloc/free interfaces to debugfs
has been removed from the -mm tree. Its filename was
mm-slub-move-sysfs-slab-alloc-free-interfaces-to-debugfs.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Faiyaz Mohammed <[email protected]>
Subject: mm: slub: move sysfs slab alloc/free interfaces to debugfs

alloc_calls and free_calls implementation in sysfs have two issues, one is PAGE_SIZE limitation of sysfs and other is it does not adhere to "one value per file" rule.

To overcome this issues, move the alloc_calls and free_calls implementation to debugfs.

Debugfs cache will be created if SLAB_STORE_USER flag is set.

Rename the alloc_calls/free_calls to alloc_traces/free_traces, to be inline with what it does.

---

 mm/slab.h        |    6 
 mm/slab_common.c |    2 
 mm/slub.c        |  274 +++++++++++++++++++++++++++++----------------
 3 files changed, 189 insertions(+), 93 deletions(-)
mm/slab_common.c renamed from mm/slab_common.c~mm-slub-move-sysfs-slab-alloc-free-interfaces-to-debugfs +2 -0
@@ -448,6 +448,7 @@ static void slab_caches_to_rcu_destroy_w
 	rcu_barrier();
 
 	list_for_each_entry_safe(s, s2, &to_destroy, list) {
+		debugfs_slab_release(s);
 		kfence_shutdown_cache(s);
 #ifdef SLAB_SUPPORTS_SYSFS
 		sysfs_slab_release(s);
@@ -475,6 +476,7 @@ static int shutdown_cache(struct kmem_ca
 		schedule_work(&slab_caches_to_rcu_destroy_work);
 	} else {
 		kfence_shutdown_cache(s);
+		debugfs_slab_release(s);
 #ifdef SLAB_SUPPORTS_SYSFS
 		sysfs_slab_unlink(s);
 		sysfs_slab_release(s);
mm/slab.h renamed from mm/slab.h~mm-slub-move-sysfs-slab-alloc-free-interfaces-to-debugfs +6 -0
@@ -631,6 +631,12 @@ static inline bool slab_want_init_on_fre
 	return false;
 }
 
+#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_SLUB_DEBUG)
+void debugfs_slab_release(struct kmem_cache *);
+#else
+static inline void debugfs_slab_release(struct kmem_cache *s) { }
+#endif
+
 #ifdef CONFIG_PRINTK
 #define KS_ADDRS_COUNT 16
 struct kmem_obj_info {
mm/slub.c renamed from mm/slub.c~mm-slub-move-sysfs-slab-alloc-free-interfaces-to-debugfs +181 -93

328 lines not on this page · raw message

_

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