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

Matthew Wilcox
2022-05-17T03:54:41Z

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.