Re: [PATCH v5] tracing: add 'accounted' entry into output of allocation tracepoints

From: Vasily Averin
Date: Tue May 31 2022 - 12:58:28 EST


On 5/31/22 14:46, Hyeonggon Yoo wrote:
> On Mon, May 30, 2022 at 10:47:26AM +0300, Vasily Averin wrote:
> Looks good to me.
> Reviewed-by: Hyeonggon Yoo <42.hyeyoo@xxxxxxxxx>
>
> a small comment:
>>
>> TP_fast_assign(
>> @@ -33,42 +35,46 @@ DECLARE_EVENT_CLASS(kmem_alloc,
>> __entry->bytes_req = bytes_req;
>> __entry->bytes_alloc = bytes_alloc;
>> __entry->gfp_flags = (__force unsigned long)gfp_flags;
>> + __entry->accounted = (gfp_flags & __GFP_ACCOUNT) ||
>> + (s && s->flags & SLAB_ACCOUNT);
>> ),
>>
>
> It doesn't make sense for SLOB to print accounted=true because SLOB does
> not support object accounting.

Thank you very much for this comment.
SLAB_ACCOUNT is not defined for SLOB, but __GFP_ACCOUNT really can incorrectly
set this field to true.
I'll think how to handle this correctly.

Thank you,
Vasily Averin