lkml.org 
[lkml]   [2022]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2022-11-23 00:17    [W:0.068 / U:1.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site