From: Michal Hocko <mhocko@suse.com>
To: Dmitry Rokosov <ddrokosov@salutedevices.com>
Cc: rostedt@goodmis.org, mhiramat@kernel.org, hannes@cmpxchg.org,
roman.gushchin@linux.dev, shakeelb@google.com,
muchun.song@linux.dev, akpm@linux-foundation.org,
kernel@sberdevices.ru, rockosov@gmail.com,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH v2 2/2] mm: memcg: introduce new event to trace shrink_memcg
Date: Wed, 22 Nov 2023 11:23:24 +0100 [thread overview]
Message-ID: <ZV3WnIJMzxT-Zkt4@tiehlicka> (raw)
In-Reply-To: <20231122100156.6568-3-ddrokosov@salutedevices.com>
On Wed 22-11-23 13:01:56, Dmitry Rokosov wrote:
> The shrink_memcg flow plays a crucial role in memcg reclamation.
> Currently, it is not possible to trace this point from non-direct
> reclaim paths.
Is this really true? AFAICS we have
mm_vmscan_lru_isolate
mm_vmscan_lru_shrink_active
mm_vmscan_lru_shrink_inactive
which are in the vry core of the memory reclaim. Sure post processing
those is some work.
[...]
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 45780952f4b5..6d89b39d9a91 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -6461,6 +6461,12 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
> */
> cond_resched();
>
> +#ifdef CONFIG_MEMCG
> + trace_mm_vmscan_memcg_shrink_begin(sc->order,
> + sc->gfp_mask,
> + memcg);
> +#endif
this is a common code path for node and direct reclaim which means that
we will have multiple begin/end tracepoints covering similar operations.
To me that sounds excessive. If you are missing a cumulative kswapd
alternative to
mm_vmscan_direct_reclaim_begin
mm_vmscan_direct_reclaim_end
mm_vmscan_memcg_reclaim_begin
mm_vmscan_memcg_reclaim_end
mm_vmscan_memcg_softlimit_reclaim_begin
mm_vmscan_memcg_softlimit_reclaim_end
mm_vmscan_node_reclaim_begin
mm_vmscan_node_reclaim_end
then place it into kswapd path. But it would be really great to
elaborate some more why this is really needed. Cannot you simply
aggregate stats for kswapd from existing tracepoints?
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2023-11-22 10:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 10:01 [PATCH v2 0/2] mm: memcg: improve vmscan tracepoints Dmitry Rokosov
2023-11-22 10:01 ` [PATCH v2 1/2] mm: memcg: print out cgroup name in the memcg tracepoints Dmitry Rokosov
2023-11-23 7:21 ` Shakeel Butt
2023-11-23 8:03 ` Dmitry Rokosov
2023-11-23 8:15 ` Shakeel Butt
2023-11-23 8:45 ` Dmitry Rokosov
2023-11-23 11:21 ` Dmitry Rokosov
[not found] ` <20231122100156.6568-3-ddrokosov@salutedevices.com>
2023-11-22 10:23 ` Michal Hocko [this message]
2023-11-22 10:58 ` [PATCH v2 2/2] mm: memcg: introduce new event to trace shrink_memcg Dmitry Rokosov
2023-11-22 13:24 ` Michal Hocko
2023-11-22 18:57 ` Dmitry Rokosov
2023-11-23 11:26 ` Dmitry Rokosov
2023-11-27 9:25 ` Michal Hocko
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=ZV3WnIJMzxT-Zkt4@tiehlicka \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=bpf@vger.kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=ddrokosov@salutedevices.com \
--cc=hannes@cmpxchg.org \
--cc=kernel@sberdevices.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhiramat@kernel.org \
--cc=muchun.song@linux.dev \
--cc=rockosov@gmail.com \
--cc=roman.gushchin@linux.dev \
--cc=rostedt@goodmis.org \
--cc=shakeelb@google.com \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox