mm: slub: move sysfs slab alloc/free interfaces to debugfs
Subsystems (2)
PATCH v11 1/1 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.
---
changes in v11:
- slab_debug_trace_release updated with seq_release_private.
changes in v10:
- https://lore.kernel.org/linux-mm/[email protected]/
changes in v9:
- https://lore.kernel.org/linux-mm/[email protected]/
changes in v8:
- https://lore.kernel.org/linux-mm/[email protected]/
changes in V7:
- https://lore.kernel.org/linux-mm/[email protected]/
changes in v6:
- https://lore.kernel.org/linux-mm/[email protected]/
changes in v5:
- https://lore.kernel.org/linux-mm/[email protected]/
changes in v4:
- https://lore.kernel.org/linux-mm/[email protected]/
changes in v3:
- https://lore.kernel.org/linux-mm/[email protected]/
changes in v2:
- https://lore.kernel.org/linux-mm/[email protected]/
changes in v1
- https://lore.kernel.org/linux-mm/[email protected]/
mm/slab.h | 6 ++ mm/slab_common.c | 2 + mm/slub.c | 282 +++++++++++++++++++++++++++++++++++++------------------ 3 files changed, 197 insertions(+), 93 deletions(-)
mm/slab.h +6 -0
@@ -630,6 +630,12 @@ 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 +#ifdef CONFIG_PRINTK #define KS_ADDRS_COUNT 16 struct kmem_obj_info {
mm/slab_common.c +2 -0
@@ -449,6 +449,7 @@ static void slab_caches_to_rcu_destroy_workfn(struct work_struct *work)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);
@@ -476,6 +477,7 @@ static int shutdown_cache(struct kmem_cache *s)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/slub.c +190 -93
336 lines not on this page · raw message
*/
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Quoted 7 lines · Faiyaz Mohammed
alloc_callsandfree_callsimplementation in sysfs have two issues, one isPAGE_SIZElimitation of sysfs and other is it does not adhere to "one value per file" rule.To overcome this issues, move the
alloc_callsandfree_callsimplementation to debugfs.
Quoted 6 lines
Debugfs cache will be created if
SLAB_STORE_USERflag is set.Rename the alloc_calls/free_calls to alloc_traces/free_traces, to be inline with what it does.
Signed-off-by Faiyaz Mohammed <[email protected]>
Thanks!
Quoted 8 lines · Faiyaz Mohammed
alloc_callsandfree_callsimplementation in sysfs have two issues, one isPAGE_SIZElimitation of sysfs and other is it does not adhere to "one value per file" rule.To overcome this issues, move the
alloc_callsandfree_callsimplementation to debugfs.
Quoted 7 lines
Debugfs cache will be created if
SLAB_STORE_USERflag is set.Rename the alloc_calls/free_calls to alloc_traces/free_traces, to be inline with what it does.
Signed-off-by Faiyaz Mohammed <[email protected]>---
It seems you missed the version bump along with changelog. Note, some maintainers (actually quite many I think) are using tools to fetch up the patches and two patches with the same version is a problem. Hence I do not consider it a nit-pick.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 14 lines · Andy Shevchenko
Quoted 13 lines · Faiyaz Mohammed
alloc_callsandfree_callsimplementation in sysfs have two issues, one isPAGE_SIZElimitation of sysfs and other is it does not adhere to "one value per file" rule.To overcome this issues, move the
alloc_callsandfree_callsimplementation to debugfs.Debugfs cache will be created if
SLAB_STORE_USERflag is set.Rename the alloc_calls/free_calls to alloc_traces/free_traces, to be inline with what it does.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Faiyaz Mohammed <[email protected]>---
It seems you missed the version bump along with changelog. Note, some maintainers (actually quite many I think) are using tools to fetch up the patches and two patches with the same version is a problem. Hence I do not consider it a nit-pick.
Hmmm, I think to avoid same version problem I have to push same patch with new version number and thank you for your patience.
Thanks and regards,
Mohammed Faiyaz
Quoted 20 lines · Faiyaz Mohammed
Quoted 17 lines · Andy Shevchenko
Quoted 15 lines · Faiyaz Mohammed
alloc_callsandfree_callsimplementation in sysfs have two issues, one isPAGE_SIZElimitation of sysfs and other is it does not adhere to "one value per file" rule.To overcome this issues, move the
alloc_callsandfree_callsimplementation to debugfs.Debugfs cache will be created if
SLAB_STORE_USERflag is set.Rename the alloc_calls/free_calls to alloc_traces/free_traces, to be inline with what it does.
Signed-off-by Faiyaz Mohammed <[email protected]>---
Quoted 7 lines
Quoted 5 lines
It seems you missed the version bump along with changelog. Note, some maintainers (actually quite many I think) are using tools to fetch up the patches and two patches with the same version is a problem. Hence I do not consider it a nit-pick.
Hmmm, I think to avoid same version problem I have to push same patch with new version number and thank you for your patience.
I *think* Andrew wouldn't have this issue, so maybe resend only if he says it's needed.
On the other hand I did have troubles to apply the last version locally, patch (tool) complained of patch (file) being malformed at the end. Did you add or delete lines from it after generating the patch? I had to use the recountdiff tool to fix this. If you're going to resend, please make sure it's without the same issue.
Quoted 3 lines
Thanks and regards,
Mohammed Faiyaz
Quoted 26 lines · Vlastimil Babka
Quoted 25 lines · Faiyaz Mohammed
Quoted 22 lines · Andy Shevchenko
Quoted 8 lines · Faiyaz Mohammed
alloc_callsandfree_callsimplementation in sysfs have two issues, one isPAGE_SIZElimitation of sysfs and other is it does not adhere to "one value per file" rule.To overcome this issues, move the
alloc_callsandfree_callsimplementation to debugfs.Quoted 7 lines
Debugfs cache will be created if
SLAB_STORE_USERflag is set.Rename the alloc_calls/free_calls to alloc_traces/free_traces, to be inline with what it does.
Signed-off-by Faiyaz Mohammed <[email protected]>---
It seems you missed the version bump along with changelog. Note, some maintainers (actually quite many I think) are using tools to fetch up the patches and two patches with the same version is a problem. Hence I do not consider it a nit-pick.
Quoted 5 lines
Quoted 2 lines
Hmmm, I think to avoid same version problem I have to push same patch with new version number and thank you for your patience.
I *think* Andrew wouldn't have this issue, so maybe resend only if he says it's needed.
Sure, I will send if he ask.
Quoted 3 lines
On the other hand I did have troubles to apply the last version locally, patch (tool) complained of patch (file) being malformed at the end. Did you add or delete lines from it after generating the patch? I had to use the recountdiff
Yes, I added one line manually, I think that causes the issue.
Quoted 3 lines
tool to fix this. If you're going to resend, please make sure it's without the same issue.
Okay
Quoted 4 lines
Quoted 3 lines
Thanks and regards,
Mohammed Faiyaz
Hi Andy,
Quoted 29 lines · Faiyaz Mohammed
Quoted 26 lines · Vlastimil Babka
Quoted 25 lines · Faiyaz Mohammed
Quoted 22 lines · Andy Shevchenko
Quoted 8 lines · Faiyaz Mohammed
alloc_callsandfree_callsimplementation in sysfs have two issues, one isPAGE_SIZElimitation of sysfs and other is it does not adhere to "one value per file" rule.To overcome this issues, move the
alloc_callsandfree_callsimplementation to debugfs.Quoted 7 lines
Debugfs cache will be created if
SLAB_STORE_USERflag is set.Rename the alloc_calls/free_calls to alloc_traces/free_traces, to be inline with what it does.
Signed-off-by Faiyaz Mohammed <[email protected]>---
It seems you missed the version bump along with changelog. Note, some maintainers (actually quite many I think) are using tools to fetch up the patches and two patches with the same version is a problem. Hence I do not consider it a nit-pick.
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
Hmmm, I think to avoid same version problem I have to push same patch with new version number and thank you for your patience.
I *think* Andrew wouldn't have this issue, so maybe resend only if he says it's needed.
Sure, I will send if he ask.
Do I need to send patch with new version number?.
Quoted 14 lines
Quoted 3 lines
On the other hand I did have troubles to apply the last version locally, patch (tool) complained of patch (file) being malformed at the end. Did you add or delete lines from it after generating the patch? I had to use the recountdiff
Yes, I added one line manually, I think that causes the issue.
Quoted 3 lines
tool to fix this. If you're going to resend, please make sure it's without the same issue.
Okay
Quoted 4 lines
Quoted 3 lines
Thanks and regards,
Mohammed Faiyaz
Quoted 3 lines · Faiyaz Mohammed
Quoted 2 lines · Faiyaz Mohammed
Quoted 1 line · Vlastimil Babka
On 6/8/21 7:11 PM, Faiyaz Mohammed wrote:
...
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines
I *think* Andrew wouldn't have this issue, so maybe resend only if he says it's needed.
Sure, I will send if he ask.
Do I need to send patch with new version number?.
Always make your intentions clear. Currently they are unclear (two different submissions with the same versions => confusing).
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
On the other hand I did have troubles to apply the last version locally, patch (tool) complained of patch (file) being malformed at the end. Did you add or delete lines from it after generating the patch? I had to use the recountdiff
Yes, I added one line manually, I think that causes the issue.
Quoted 3 lines
tool to fix this. If you're going to resend, please make sure it's without the same issue.
Okay
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 9 lines · Faiyaz Mohammed
Hi Andy,
Quoted 6 lines · Faiyaz Mohammed
Quoted 3 lines · Vlastimil Babka
Quoted 2 lines · Faiyaz Mohammed
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines · Andy Shevchenko
Hmmm, I think to avoid same version problem I have to push same patch with new version number and thank you for your patience.
I *think* Andrew wouldn't have this issue, so maybe resend only if he says it's needed.
Sure, I will send if he ask.
Do I need to send patch with new version number?.
If you send a v12 patch that's not malformed, and with my reviewed-by added, it can't hurt.