mm/tracing: add 'accounted' entry into output of allocation tracepoints
authorVasily Averin <vvs@openvz.org>
Fri, 3 Jun 2022 03:21:49 +0000 (06:21 +0300)
committerVlastimil Babka <vbabka@suse.cz>
Mon, 4 Jul 2022 15:11:27 +0000 (17:11 +0200)
commitb347aa7b57477f71c740e2bbc6d1078a7109ba23
tree2e2f1c711884b182d0134287c6b219733684ccf6
parent0c7e0d699ef1430d7f4cf12b4b1d097af58b5515
mm/tracing: add 'accounted' entry into output of allocation tracepoints

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>
Link: https://lore.kernel.org/r/c418ed25-65fe-f623-fbf8-1676528859ed@openvz.org
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
include/trace/events/kmem.h
mm/slab.c
mm/slab_common.c
mm/slob.c
mm/slub.c