From: Johannes Weiner <hannes@cmpxchg.org>
To: Georgi Djakov <quic_c_gdjako@quicinc.com>
Cc: vincent.guittot@linaro.org, juri.lelli@redhat.com,
peterz@infradead.org, mingo@redhat.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
mhocko@kernel.org, vdavydov.dev@gmail.com, tj@kernel.org,
axboe@kernel.dk, cgroups@vger.kernel.org,
linux-block@vger.kernel.org, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
djakov@kernel.org
Subject: Re: [RFC] psi: Add additional PSI counters for each type of memory pressure
Date: Wed, 10 Nov 2021 11:44:26 -0500 [thread overview]
Message-ID: <YYv26rKib03JnYZN@cmpxchg.org> (raw)
In-Reply-To: <1636558597-248294-1-git-send-email-quic_c_gdjako@quicinc.com>
On Wed, Nov 10, 2021 at 07:36:37AM -0800, Georgi Djakov wrote:
> From: Carlos Ramirez <carlrami@codeaurora.org>
>
> Calculates psi totals for memory pressure subevents:
> compaction, thrashing, direct compaction, direct reclaim, and kswapd0.
> Uses upper 16 bits of psi_flags to track memory subevents.
Oof, that's quite heavy both in terms of branches, but also in terms
of cache - which, depending on wakeup pattern and cpu topology can
really hurt those paths.
What's the usecase? Do you have automation that needs to act on one
type of stall but not the others, for example?
I find that looking at vmstat events on hosts with elevated pressure
tends to give a pretty good idea of the source. It should also be
possible to whip up a short bpftrace script to track down culprit
callstacks of psi_memstall_*.
> @@ -1053,19 +1128,56 @@ int psi_show(struct seq_file *m, struct psi_group *group, enum psi_res res)
> + seq_printf(m, "%s avg10=%lu.%02lu avg60=%lu.%02lu avg300=%lu.%02lu total=%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n",
> full ? "full" : "some",
> LOAD_INT(avg[0]), LOAD_FRAC(avg[0]),
> LOAD_INT(avg[1]), LOAD_FRAC(avg[1]),
> LOAD_INT(avg[2]), LOAD_FRAC(avg[2]),
> - total);
> + total, total_blk_cgroup_throttle, total_bio, total_compaction,
> + total_thrashing, total_cgroup_reclaim_high,
> + total_cgroup_reclaim_high_sleep, total_cgroup_try_charge,
> + total_direct_compaction, total_direct_reclaim, total_read_swappage,
> + total_kswapd);
The file format is a can of worms. I doubt we can change this at this
point without breaking parsers, so those numbers would have to live
somewhere else. But let's figure out the above questions before
worrying about this.
next prev parent reply other threads:[~2021-11-10 16:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 15:36 Georgi Djakov
2021-11-10 16:07 ` Michal Hocko
2021-11-10 16:45 ` Georgi Djakov
2021-11-10 16:14 ` Peter Zijlstra
2021-11-10 16:45 ` Georgi Djakov
2021-11-10 17:48 ` Suren Baghdasaryan
2021-11-10 16:44 ` Johannes Weiner [this message]
2021-12-01 19:26 ` Georgi Djakov
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=YYv26rKib03JnYZN@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=cgroups@vger.kernel.org \
--cc=djakov@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=quic_c_gdjako@quicinc.com \
--cc=rostedt@goodmis.org \
--cc=tj@kernel.org \
--cc=vdavydov.dev@gmail.com \
--cc=vincent.guittot@linaro.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: 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