From: Vlastimil Babka <vbabka@suse.cz> To: Vasily Averin <vvs@openvz.org> Cc: kernel@openvz.org, linux-kernel@vger.kernel.org, "Andrew Morton" <akpm@linux-foundation.org>, linux-mm@kvack.org, "Shakeel Butt" <shakeelb@google.com>, "Roman Gushchin" <roman.gushchin@linux.dev>, "Michal Koutný" <mkoutny@suse.com>, "Steven Rostedt" <rostedt@goodmis.org>, "Ingo Molnar" <mingo@redhat.com>, "Michal Hocko" <mhocko@suse.com>, "Muchun Song" <songmuchun@bytedance.com>, "Hyeonggon Yoo" <42.hyeyoo@gmail.com>, "Matthew Wilcox" <willy@infradead.org>, "Joonsoo Kim" <iamjoonsoo.kim@lge.com>, "David Rientjes" <rientjes@google.com>, "Pekka Enberg" <penberg@kernel.org>, "Christoph Lameter" <cl@linux.com>, cgroups@vger.kernel.org Subject: Re: [PATCH mm v6] mm/tracing: add 'accounted' entry into output of allocation tracepoints Date: Wed, 15 Jun 2022 11:41:48 +0200 [thread overview] Message-ID: <9a4a9afe-bbe1-4cb3-713b-f1e4e6d2a049@suse.cz> (raw) In-Reply-To: <c418ed25-65fe-f623-fbf8-1676528859ed@openvz.org> On 6/3/22 05:21, Vasily Averin wrote: > Slab caches marked with SLAB_ACCOUNT force accounting for every > allocation from this cache even if __GFP_ACCOUNT flag is not passed. > Unfortunately, at the moment this flag is not visible in ftrace output, > and this makes it difficult to analyze the accounted allocations. > > This patch adds boolean "accounted" entry into trace output, > and set it to 'true' for calls used __GFP_ACCOUNT flag and > for allocations from caches marked with SLAB_ACCOUNT. > Set it to 'false' if accounting is disabled in configs. > > Signed-off-by: Vasily Averin <vvs@openvz.org> > Acked-by: Shakeel Butt <shakeelb@google.com> > Acked-by: Roman Gushchin <roman.gushchin@linux.dev> > Acked-by: Muchun Song <songmuchun@bytedance.com> > Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Thanks, added to slab/for-5.20/tracing > > --- > v6: > 1) subject changed from "tracing:" to "mm/tracing:" > 2) set flag to 'false' if accounting is disabled in configs Looks like you forgot the kmem_alloc_node variant, fixed up locally: --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h @@ -94,8 +94,9 @@ DECLARE_EVENT_CLASS(kmem_alloc_node, __entry->bytes_alloc = bytes_alloc; __entry->gfp_flags = (__force unsigned long)gfp_flags; __entry->node = node; - __entry->accounted = (gfp_flags & __GFP_ACCOUNT) || - (s && s->flags & SLAB_ACCOUNT); + __entry->accounted = IS_ENABLED(CONFIG_MEMCG_KMEM) ? + ((gfp_flags & __GFP_ACCOUNT) || + (s && s->flags & SLAB_ACCOUNT)) : false; ), TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d accounted=%s",
WARNING: multiple messages have this Message-ID (diff)
From: Vlastimil Babka <vbabka-AlSwsSmVLrQ@public.gmane.org> To: Vasily Averin <vvs-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org> Cc: kernel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Andrew Morton" <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, "Shakeel Butt" <shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>, "Roman Gushchin" <roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org>, "Michal Koutný" <mkoutny-IBi9RG/b67k@public.gmane.org>, "Steven Rostedt" <rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org>, "Ingo Molnar" <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>, "Michal Hocko" <mhocko-IBi9RG/b67k@public.gmane.org>, "Muchun Song" <songmuchun-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>, "Hyeonggon Yoo" <42.hyeyoo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, "Matthew Wilcox" <willy-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>, "Joonsoo Kim" <iamjoonsoo.kim-Hm3cg6mZ9cc@public.gmane.org>, "David Rientjes" <rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>, "Pekka Enberg" <penberg-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>, "Christoph Lameter" <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: Re: [PATCH mm v6] mm/tracing: add 'accounted' entry into output of allocation tracepoints Date: Wed, 15 Jun 2022 11:41:48 +0200 [thread overview] Message-ID: <9a4a9afe-bbe1-4cb3-713b-f1e4e6d2a049@suse.cz> (raw) In-Reply-To: <c418ed25-65fe-f623-fbf8-1676528859ed-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org> On 6/3/22 05:21, Vasily Averin wrote: > Slab caches marked with SLAB_ACCOUNT force accounting for every > allocation from this cache even if __GFP_ACCOUNT flag is not passed. > Unfortunately, at the moment this flag is not visible in ftrace output, > and this makes it difficult to analyze the accounted allocations. > > This patch adds boolean "accounted" entry into trace output, > and set it to 'true' for calls used __GFP_ACCOUNT flag and > for allocations from caches marked with SLAB_ACCOUNT. > Set it to 'false' if accounting is disabled in configs. > > Signed-off-by: Vasily Averin <vvs-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org> > Acked-by: Shakeel Butt <shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> > Acked-by: Roman Gushchin <roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org> > Acked-by: Muchun Song <songmuchun-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org> > Reviewed-by: Hyeonggon Yoo <42.hyeyoo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Thanks, added to slab/for-5.20/tracing > > --- > v6: > 1) subject changed from "tracing:" to "mm/tracing:" > 2) set flag to 'false' if accounting is disabled in configs Looks like you forgot the kmem_alloc_node variant, fixed up locally: --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h @@ -94,8 +94,9 @@ DECLARE_EVENT_CLASS(kmem_alloc_node, __entry->bytes_alloc = bytes_alloc; __entry->gfp_flags = (__force unsigned long)gfp_flags; __entry->node = node; - __entry->accounted = (gfp_flags & __GFP_ACCOUNT) || - (s && s->flags & SLAB_ACCOUNT); + __entry->accounted = IS_ENABLED(CONFIG_MEMCG_KMEM) ? + ((gfp_flags & __GFP_ACCOUNT) || + (s && s->flags & SLAB_ACCOUNT)) : false; ), TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d accounted=%s",
next prev parent reply other threads:[~2022-06-15 9:41 UTC|newest] Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-18 6:24 [PATCH v3] tracing: add 'accounted' entry into output of allocation tracepoints Vasily Averin 2022-05-18 15:09 ` Shakeel Butt 2022-05-18 15:45 ` Vasily Averin 2022-05-18 20:04 ` Steven Rostedt 2022-05-18 20:04 ` Steven Rostedt 2022-05-19 11:35 ` Vasily Averin 2022-05-19 11:35 ` Vasily Averin 2022-05-19 14:03 ` Steven Rostedt 2022-05-19 14:03 ` Steven Rostedt 2022-05-19 16:29 ` Vasily Averin 2022-05-19 16:29 ` Vasily Averin 2022-05-19 16:32 ` Steven Rostedt 2022-05-19 16:32 ` Steven Rostedt 2022-05-21 18:32 ` Vasily Averin 2022-05-21 18:32 ` Vasily Averin 2022-05-21 18:36 ` [PATCH v4] " Vasily Averin 2022-05-22 3:51 ` Hyeonggon Yoo 2022-05-22 4:33 ` Vasily Averin 2022-05-22 5:19 ` Hyeonggon Yoo 2022-05-22 5:42 ` Shakeel Butt 2022-05-22 18:53 ` Vasily Averin 2022-05-22 20:09 ` Steven Rostedt 2022-05-23 4:03 ` Vasily Averin 2022-05-23 13:12 ` Vlastimil Babka 2022-05-30 7:47 ` [PATCH v5] " Vasily Averin 2022-05-30 8:25 ` Muchun Song 2022-05-31 11:46 ` Hyeonggon Yoo 2022-05-31 16:58 ` Vasily Averin 2022-06-03 3:21 ` [PATCH mm v6] mm/tracing: " Vasily Averin 2022-06-03 3:21 ` Vasily Averin 2022-06-15 9:41 ` Vlastimil Babka [this message] 2022-06-15 9:41 ` Vlastimil Babka 2022-05-25 1:34 ` [PATCH v4] tracing: " Roman Gushchin 2022-05-25 7:33 ` Hyeonggon Yoo 2022-05-25 8:24 ` Vasily Averin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=9a4a9afe-bbe1-4cb3-713b-f1e4e6d2a049@suse.cz \ --to=vbabka@suse.cz \ --cc=42.hyeyoo@gmail.com \ --cc=akpm@linux-foundation.org \ --cc=cgroups@vger.kernel.org \ --cc=cl@linux.com \ --cc=iamjoonsoo.kim@lge.com \ --cc=kernel@openvz.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=mhocko@suse.com \ --cc=mingo@redhat.com \ --cc=mkoutny@suse.com \ --cc=penberg@kernel.org \ --cc=rientjes@google.com \ --cc=roman.gushchin@linux.dev \ --cc=rostedt@goodmis.org \ --cc=shakeelb@google.com \ --cc=songmuchun@bytedance.com \ --cc=vvs@openvz.org \ --cc=willy@infradead.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.