* + mm-slub-fix-slub_debug-disablement-for-list-of-slabs.patch added to -mm tree
@ 2021-08-02 21:04 akpm
0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2021-08-02 21:04 UTC (permalink / raw)
To: mm-commits, vjitta, vinmenon, rientjes, penberg, iamjoonsoo.kim,
cl, vbabka
The patch titled
Subject: mm: slub: fix slub_debug disabling for list of slabs
has been added to the -mm tree. Its filename is
mm-slub-fix-slub_debug-disablement-for-list-of-slabs.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-slub-fix-slub_debug-disablement-for-list-of-slabs.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-slub-fix-slub_debug-disablement-for-list-of-slabs.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Vlastimil Babka <vbabka@suse.cz>
Subject: mm: slub: fix slub_debug disabling for list of slabs
Vijayanand Jitta reports:
Consider the scenario where CONFIG_SLUB_DEBUG_ON is set
and we would want to disable slub_debug for few slabs.
Using boot parameter with slub_debug=-,slab_name syntax
doesn't work as expected i.e; only disabling debugging for
the specified list of slabs. Instead it disables debugging
for all slabs, which is wrong.
This patch fixes it by delaying the moment when the global slub_debug
flags variable is updated. In case a "slub_debug=-,slab_name" has been
passed, the global flags remain as initialized (depending on
CONFIG_SLUB_DEBUG_ON enabled or disabled) and are not simply reset to 0.
Link: https://lkml.kernel.org/r/8a3d992a-473a-467b-28a0-4ad2ff60ab82@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Vijayanand Jitta <vjitta@codeaurora.org>
Reviewed-by: Vijayanand Jitta <vjitta@codeaurora.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/slub.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
--- a/mm/slub.c~mm-slub-fix-slub_debug-disablement-for-list-of-slabs
+++ a/mm/slub.c
@@ -1400,12 +1400,13 @@ check_slabs:
static int __init setup_slub_debug(char *str)
{
slab_flags_t flags;
+ slab_flags_t global_flags;
char *saved_str;
char *slab_list;
bool global_slub_debug_changed = false;
bool slab_list_specified = false;
- slub_debug = DEBUG_DEFAULT_FLAGS;
+ global_flags = DEBUG_DEFAULT_FLAGS;
if (*str++ != '=' || !*str)
/*
* No options specified. Switch on full debugging.
@@ -1417,7 +1418,7 @@ static int __init setup_slub_debug(char
str = parse_slub_debug_flags(str, &flags, &slab_list, true);
if (!slab_list) {
- slub_debug = flags;
+ global_flags = flags;
global_slub_debug_changed = true;
} else {
slab_list_specified = true;
@@ -1426,16 +1427,18 @@ static int __init setup_slub_debug(char
/*
* For backwards compatibility, a single list of flags with list of
- * slabs means debugging is only enabled for those slabs, so the global
- * slub_debug should be 0. We can extended that to multiple lists as
+ * slabs means debugging is only changed for those slabs, so the global
+ * slub_debug should be unchanged (0 or DEBUG_DEFAULT_FLAGS, depending
+ * on CONFIG_SLUB_DEBUG_ON). We can extended that to multiple lists as
* long as there is no option specifying flags without a slab list.
*/
if (slab_list_specified) {
if (!global_slub_debug_changed)
- slub_debug = 0;
+ global_flags = slub_debug;
slub_debug_string = saved_str;
}
out:
+ slub_debug = global_flags;
if (slub_debug != 0 || slub_debug_string)
static_branch_enable(&slub_debug_enabled);
else
_
Patches currently in -mm which might be from vbabka@suse.cz are
mm-slub-fix-slub_debug-disablement-for-list-of-slabs.patch
mm-slub-fix-slub_debug-disabling-for-list-of-slabs.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
* + mm-slub-fix-slub_debug-disablement-for-list-of-slabs.patch added to -mm tree
@ 2021-07-14 1:10 akpm
0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2021-07-14 1:10 UTC (permalink / raw)
To: cl, iamjoonsoo.kim, mm-commits, penberg, rientjes, vbabka, vjitta
The patch titled
Subject: mm: slub: Fix slub_debug disablement for list of slabs
has been added to the -mm tree. Its filename is
mm-slub-fix-slub_debug-disablement-for-list-of-slabs.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-slub-fix-slub_debug-disablement-for-list-of-slabs.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-slub-fix-slub_debug-disablement-for-list-of-slabs.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Vijayanand Jitta <vjitta@codeaurora.org>
Subject: mm: slub: Fix slub_debug disablement for list of slabs
Consider the scenario where CONFIG_SLUB_DEBUG_ON is set and we would want
to disable slub_debug for few slabs. Using boot parameter with
slub_debug=-,slab_name syntax doesn't work as expected i.e; only disabling
debugging for the specified list of slabs, instead it disables debugging
for all slabs. Fix this.
Link: https://lkml.kernel.org/r/1626176750-13099-1-git-send-email-vjitta@codeaurora.org
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.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>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/slub.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/mm/slub.c~mm-slub-fix-slub_debug-disablement-for-list-of-slabs
+++ a/mm/slub.c
@@ -1415,6 +1415,7 @@ static int __init setup_slub_debug(char
char *slab_list;
bool global_slub_debug_changed = false;
bool slab_list_specified = false;
+ bool slab_list_debug_disable = true;
slub_debug = DEBUG_DEFAULT_FLAGS;
if (*str++ != '=' || !*str)
@@ -1422,7 +1423,6 @@ static int __init setup_slub_debug(char
* No options specified. Switch on full debugging.
*/
goto out;
-
saved_str = str;
while (str) {
str = parse_slub_debug_flags(str, &flags, &slab_list, true);
@@ -1431,6 +1431,8 @@ static int __init setup_slub_debug(char
slub_debug = flags;
global_slub_debug_changed = true;
} else {
+ if (flags || !IS_ENABLED(CONFIG_SLUB_DEBUG_ON))
+ slab_list_debug_disable = false;
slab_list_specified = true;
}
}
@@ -1442,7 +1444,7 @@ static int __init setup_slub_debug(char
* long as there is no option specifying flags without a slab list.
*/
if (slab_list_specified) {
- if (!global_slub_debug_changed)
+ if (!global_slub_debug_changed && !slab_list_debug_disable)
slub_debug = 0;
slub_debug_string = saved_str;
}
_
Patches currently in -mm which might be from vjitta@codeaurora.org are
mm-slub-fix-slub_debug-disablement-for-list-of-slabs.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-02 21:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 21:04 + mm-slub-fix-slub_debug-disablement-for-list-of-slabs.patch added to -mm tree akpm
-- strict thread matches above, loose matches on Subject: below --
2021-07-14 1:10 akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.