On Mon, 21 Nov 2022 21:50:23 +0800 Feng Tang <feng.tang@xxxxxxxxx> wrote: > +#ifndef CONFIG_SLOB > +#define is_kmalloc_cache(s) ((s)->flags & SLAB_KMALLOC) > +#else > +#define is_kmalloc_cache(s) (false) > +#endif Could be implemented as a static inline C function, yes? If so, that's always best. For (silly) example, consider the behaviour of x = is_kmalloc_cache(s++); with and without CONFIG_SLOB.