From: Johannes Weiner <hannes@cmpxchg.org>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Shakeel Butt <shakeelb@google.com>,
Michal Hocko <mhocko@suse.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Yu Zhao <yuzhao@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: memcg: fix swapcached stat accounting
Date: Mon, 5 Dec 2022 09:21:37 -0500 [thread overview]
Message-ID: <Y43+cUNTrq3VKgU2@cmpxchg.org> (raw)
In-Reply-To: <b8b96ee0-1e1e-85f8-df97-c82a11d7cd14@google.com>
On Sun, Dec 04, 2022 at 05:01:03PM -0800, Hugh Dickins wrote:
> I'd been worried by high "swapcached" counts in memcg OOM reports,
> thought we had a problem freeing swapcache, but it was just the
> accounting that was wrong.
>
> Two issues:
>
> 1. When __remove_mapping() removes swapcache, __delete_from_swap_cache()
> relies on memcg_data for the right counts to be updated; but that had
> already been reset by mem_cgroup_swapout(). Swap those calls around -
> mem_cgroup_swapout() does not require the swapcached flag to be set.
>
> 6.1 commit ac35a4902374 ("mm: multi-gen LRU: minimal implementation")
> already made a similar swap for workingset_eviction(), but not for this.
>
> 2. memcg's "swapcached" count was added for memcg v2 stats, but displayed
> on OOM even for memcg v1: so mem_cgroup_move_account() ought to move it.
>
> Fixes: b6038942480e ("mm: memcg: add swapcache stat for memcg v2")
> Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
prev parent reply other threads:[~2022-12-05 14:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 1:01 Hugh Dickins
2022-12-05 5:03 ` Shakeel Butt
2022-12-05 14:21 ` Johannes Weiner [this message]
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=Y43+cUNTrq3VKgU2@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=roman.gushchin@linux.dev \
--cc=shakeelb@google.com \
--cc=yuzhao@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