[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b728f944-e3ae-cdb6-5f02-2fb21466b2fb@openvz.org>
Date: Thu, 19 May 2022 14:35:46 +0300
From: Vasily Averin <vvs@...nvz.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: YoPOhRctb8wwbmY5@...bon, Shakeel Butt <shakeelb@...gle.com>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Vlastimil Babka <vbabka@...e.cz>,
Matthew Wilcox <willy@...radead.org>,
Hyeonggon Yoo <42.hyeyoo@...il.com>,
Muchun Song <songmuchun@...edance.com>, kernel@...nvz.org,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
Joonsoo Kim <iamjoonsoo.kim@....com>,
David Rientjes <rientjes@...gle.com>,
Pekka Enberg <penberg@...nel.org>,
Christoph Lameter <cl@...ux.com>,
Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH v3] tracing: add 'accounted' entry into output of
allocation tracepoints
On 5/18/22 23:04, Steven Rostedt wrote:
> On Wed, 18 May 2022 09:24:51 +0300
> Vasily Averin <vvs@...nvz.org> wrote:
>
> FYI, the subject should be something like: mm/tracing:
> Because "tracing:" is reserved for tracing infrastructure updates.
Thank you for noticing.
>> @@ -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);
>
> Now you could make this even faster in the fast path and save just the
> s->flags.
>
> __entry->sflags = s ? s->flags : 0;
>
>> ),
>>
>> - TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s",
>> + TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s accounted=%s",
>> (void *)__entry->call_site,
>> __entry->ptr,
>> __entry->bytes_req,
>> __entry->bytes_alloc,
>> - show_gfp_flags(__entry->gfp_flags))
>> + show_gfp_flags(__entry->gfp_flags),
>> + __entry->accounted ? "true" : "false")
>
> And then have: "accounted=%s":
>
> (__entry->gfp_flags & __GFP_ACCOUNT) ||
> (__entry->sflags & SLAB_ACCOUNT) ? "true" : "false"
Unfortunately this returns back sparse warnings about bitwise gfp_t and slab_flags_t casts.
Could you please explain why your variant is faster?
Thank you,
Vasily Averin
Powered by blists - more mailing lists