Messages in this thread | | | Date | Tue, 22 Nov 2022 15:17:18 -0800 | From | Andrew Morton <> | Subject | Re: [PATCH -next 1/2] mm/slab: add is_kmalloc_cache() helper macro |
| |
On Tue, 22 Nov 2022 13:30:19 +0800 Feng Tang <feng.tang@intel.com> wrote:
> > If so, that's always best. For (silly) example, consider the behaviour > > of > > > > x = is_kmalloc_cache(s++); > > > > with and without CONFIG_SLOB. > > Another solution I can think of is putting the implementation into > slab_common.c, like the below?
I'm not sure that's much of an improvement on the macro :(
How about we go with the macro and avoid the expression-with-side-effects gotcha (and the potential CONFIG_SLOB=n unused-variable gotcha)? That would involve evaluating the arg within the CONFIG_SLOB=y version of the macro.
| |