Re: [PATCH] tracing: add ACCOUNT flag for allocations from marked slab caches

From: Matthew Wilcox
Date: Mon May 16 2022 - 23:54:49 EST


On Tue, May 17, 2022 at 06:32:28AM +0300, Vasily Averin wrote:
> > Should this 'if' be unlikely() or should we trace cachep->flags
> > explicitly to avoid this branch altogether?
>
> In general output of cachep->flags can be useful, but at the moment
> I am only interested in SLAB_ACCOUNT flag and in any case I would
> prefer to translate it to GFP_ACCOUNT.
> So I'm going to use unlikely() in v2 patch version.

It's still going to be an extra test, and networking is extremely
sensitive to extra instructions if tracing is compiled out. Passing
in 'cachep' to the trace call looked like the best suggestion to me.