Re: [PATCH v3 06/13] mm/slab: abstract slabobj_ext.ref access
Harry Yoo <[email protected]> Tue, 28 Jul 2026 22:41:05 +0900
| Newsgroups | org.kernel.vger.cgroups,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <amivCT7AaPux-GSK@thinkpad> |
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 <[email protected]> > Reviewed-by: Hao Li <[email protected]> > Signed-off-by: Vlastimil Babka (SUSE) <[email protected]> > --- Looks good to me, Reviewed-by: Harry Yoo (Oracle) <[email protected]> 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(-)