Re: [RFC PATCH 1/5] mm, slub: extend slub_debug syntax for multiple blocks

Vlastimil Babka
2020-06-08T16:59:01Z

On 6/5/20 11:06 PM, Kees Cook wrote:
>> @@ -83,6 +88,18 @@ in low memory situations or if there's high fragmentation of memory. To
>>
>> slub_debug=O
>>
>> +You can apply different options to different list of slab names, using blocks
>> +of options. This will enable red zoning for dentry and user tracking for
>> +kmalloc. All other slabs will not get any debugging enabled::
>> +
>> + slub_debug=Z,dentry;U,kmalloc-*
>> +
>> +You can also enable options (e.g. sanity checks and poisoning) for all caches
>> +except some that are deemed too performance critical and don't need to be
>> +debugged::
>
> Just for more clarity, how about:
>
> ... debugged by starting the list with "-" (to mean "all except the
> following")::

Hmm, "-" is not exactly "all except the following", but "no debugging", as
explained in the list of debug options earlier in the file.

So I'm updating it to this:

You can also enable options (e.g. sanity checks and poisoning) for all caches
except some that are deemed too performance critical and don't need to be
debugged by specifying global debug options followed by a list of slab names
with "-" as options::

slub_debug=FZ;-,zs_handle,zspage

>> +
>> + slub_debug=FZ;-,zs_handle,zspage
>> +
>> In case you forgot to enable debugging on the kernel command line: It is
>> possible to enable debugging manually when the kernel is up. Look at the
>> contents of::
>
> Everything else looks great; very nice! :)
>
> Reviewed-by: Kees Cook <keescook@chromium.org>

Thanks!