On Thu, 24 Jan 2019 15:00:23 +0800 <miles.c...@mediatek.com> wrote:

> From: Miles Chen <miles.c...@mediatek.com>
> 
> When debugging slab errors in slub.c, sometimes we have to trigger
> a panic in order to get the coredump file. Add a debug option
> SLAB_WARN_ON_ERROR to toggle WARN_ON() when the option is set.
> 
> Change since v1:
> 1. Add a special debug option SLAB_WARN_ON_ERROR and toggle WARN_ON()
> if it is set.
> 2. SLAB_WARN_ON_ERROR can be set by kernel parameter slub_debug.
> 

Hopefully the slab developers will have an opinion on this.

> --- a/Documentation/vm/slub.rst
> +++ b/Documentation/vm/slub.rst
> @@ -52,6 +52,7 @@ Possible debug options are::
>       A               Toggle failslab filter mark for the cache
>       O               Switch debugging off for caches that would have
>                       caused higher minimum slab orders
> +     W               Toggle WARN_ON() on slab errors
>       -               Switch all debugging off (useful if the kernel is
>                       configured with CONFIG_SLUB_DEBUG_ON)

This documentation is poorly phrased.  The term "toggle" means to
invert the value of a boolean: if it was 1, make it 0 and if it was 0,
make it 1.  But that isn't what these options do.  Something like
"enable/disable" would be better.   So...

--- a/Documentation/vm/slub.rst~mm-slub-introduce-slab_warn_on_error-fix
+++ a/Documentation/vm/slub.rst
@@ -49,10 +49,10 @@ Possible debug options are::
        P               Poisoning (object and padding)
        U               User tracking (free and alloc)
        T               Trace (please only use on single slabs)
-       A               Toggle failslab filter mark for the cache
+       A               Enable/disable failslab filter mark for the cache
        O               Switch debugging off for caches that would have
                        caused higher minimum slab orders
-       W               Toggle WARN_ON() on slab errors
+       W               Enable/disable WARN_ON() on slab errors
        -               Switch all debugging off (useful if the kernel is
                        configured with CONFIG_SLUB_DEBUG_ON)
 
_

Reply via email to