Re: [PATCH] mm: slub: Fix slub_debug disablement for list of slabs

From: David Rientjes
Date: Sun Aug 01 2021 - 23:26:15 EST

On Tue, 27 Jul 2021, Vlastimil Babka wrote:

> From 81a225fe31e53701902bb4caa9ab1524eb044cbc Mon Sep 17 00:00:00 2001
> From: Vlastimil Babka <vbabka@xxxxxxx>
> Date: Tue, 13 Jul 2021 17:15:50 +0530
> Subject: [PATCH] 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.
> Reported-by: Vijayanand Jitta <vjitta@xxxxxxxxxxxxxx>
> Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx>
> Reviewed-by: Vijayanand Jitta <vjitta@xxxxxxxxxxxxxx>

Acked-by: David Rientjes <rientjes@xxxxxxxxxx>

Looks better, thanks!