Re: [PATCH v3 06/13] mm/slab: abstract slabobj_ext.ref access
From: Harry Yoo
Date: Tue Jul 28 2026 - 09:45:26 EST
On Mon, Jul 27, 2026 at 02:54:00PM +0200, Vlastimil Babka (SUSE) wrote:
> In preparation for changes to the structure, abstract access to the ref
> field with a slab_obj_ext_codetag_ref() function. Rename the field to
> _ctref to make an unexpected direct access a compile error.
>
> No functional change intended.
>
> Reviewed-by: Suren Baghdasaryan <surenb@xxxxxxxxxx>
> Reviewed-by: Hao Li <hao.li@xxxxxxxxx>
> Signed-off-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
> ---
Looks good to me,
Reviewed-by: Harry Yoo (Oracle) <harry@xxxxxxxxxx>
With a suggestion: it would be nice to have debug warnings
that trigger when slab_obj_ext_codetag_ref() is compiled but
not supposed to be called.
e.g.) for kfence objects, or later in the series when we
reduce slabobj_ext memory (!slab_obj_ext_has_codetag())
Similarly, it would be nice (later in the series) to have a warning
in slab_obj_ext_objcg() when slab_needs_objcg() returns false.
> mm/slab.h | 10 +++++++++-
> mm/slub.c | 42 ++++++++++++++++++++++++++++--------------
> 2 files changed, 37 insertions(+), 15 deletions(-)