FROMGIT: 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.

Link: https://lkml.kernel.org/r/1623438200-19361-1-git-send-email-faiyazm@codeaurora.org
Signed-off-by: Faiyaz Mohammed <faiyazm@codeaurora.org>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
BUG: 176858818
(cherry picked from commit d48f3da28a5b4c63bb76a2b4dea983aee38d9d2e
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit?h=next-20210615&id=d48f3da28a5b4c63bb76a2b4dea983aee38d9d2e)

Change-Id: I5426e48b13fe9944b9d4666e3cd9f2a7a4896018
Signed-off-by: Faiyaz Mohammed <faiyazm@codeaurora.org>
This commit is contained in:
Faiyaz Mohammed
2021-06-15 09:19:37 +05:30
committed by Suren Baghdasaryan
parent 45d0c6c5aa
commit 54e7412d4f
3 changed files with 198 additions and 98 deletions

View File

@@ -681,4 +681,10 @@ static inline bool slab_want_init_on_free(struct kmem_cache *c)
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
#endif /* MM_SLAB_H */