From: Yosry Ahmed <yosryahmed@google.com>
To: Liu Shixin <liushixin2@huawei.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Michal Koutný" <mkoutny@suse.com>, "Tejun Heo" <tj@kernel.org>,
"Zefan Li" <lizefan.x@bytedance.com>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Michal Hocko" <mhocko@kernel.org>,
"Kefeng Wang" <wangkefeng.wang@huawei.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] memcg: remove unused do_memsw_account in memcg1_stat_format
Date: Mon, 18 Sep 2023 12:12:06 -0700 [thread overview]
Message-ID: <CAJD7tkY3FjA90v_h8JP3+GxDSLMGL2JpbVsQupMvNXt6-fqUkg@mail.gmail.com> (raw)
In-Reply-To: <20230915105845.3199656-3-liushixin2@huawei.com>
On Fri, Sep 15, 2023 at 3:05 AM Liu Shixin <liushixin2@huawei.com> wrote:
>
> Since commit b25806dcd3d5("mm: memcontrol: deprecate swapaccounting=0 mode")
> do_memsw_account() is synonymous with !cgroup_subsys_on_dfl(memory_cgrp_subsys),
> It always equals true in memcg1_stat_format(). Remove the unused code.
>
> Suggested-by: Michal Koutný <mkoutny@suse.com>
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Reviewed-by: Yosry Ahmed <yosryahmed@google.com>
> ---
> mm/memcontrol.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 78ea10c5a636..bb9a617be046 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4112,8 +4112,6 @@ static void memcg1_stat_format(struct mem_cgroup *memcg, struct seq_buf *s)
> for (i = 0; i < ARRAY_SIZE(memcg1_stats); i++) {
> unsigned long nr;
>
> - if (memcg1_stats[i] == MEMCG_SWAP && !do_memsw_account())
> - continue;
> nr = memcg_page_state_local(memcg, memcg1_stats[i]);
> seq_buf_printf(s, "%s %lu\n", memcg1_stat_names[i],
> nr * memcg_page_state_unit(memcg1_stats[i]));
> @@ -4136,15 +4134,12 @@ static void memcg1_stat_format(struct mem_cgroup *memcg, struct seq_buf *s)
> }
> seq_buf_printf(s, "hierarchical_memory_limit %llu\n",
> (u64)memory * PAGE_SIZE);
> - if (do_memsw_account())
> - seq_buf_printf(s, "hierarchical_memsw_limit %llu\n",
> - (u64)memsw * PAGE_SIZE);
> + seq_buf_printf(s, "hierarchical_memsw_limit %llu\n",
> + (u64)memsw * PAGE_SIZE);
>
> for (i = 0; i < ARRAY_SIZE(memcg1_stats); i++) {
> unsigned long nr;
>
> - if (memcg1_stats[i] == MEMCG_SWAP && !do_memsw_account())
> - continue;
> nr = memcg_page_state(memcg, memcg1_stats[i]);
> seq_buf_printf(s, "total_%s %llu\n", memcg1_stat_names[i],
> (u64)nr * memcg_page_state_unit(memcg1_stats[i]));
> --
> 2.25.1
>
next prev parent reply other threads:[~2023-09-18 19:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 10:58 [PATCH v2 0/2] Expose swapcache stat for memcg v1 Liu Shixin
2023-09-15 10:58 ` [PATCH v2 1/2] memcg: expose " Liu Shixin
2023-09-15 10:58 ` [PATCH v2 2/2] memcg: remove unused do_memsw_account in memcg1_stat_format Liu Shixin
2023-09-18 19:12 ` Yosry Ahmed [this message]
2023-09-18 18:37 ` [PATCH v2 0/2] Expose swapcache stat for memcg v1 Tejun Heo
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=CAJD7tkY3FjA90v_h8JP3+GxDSLMGL2JpbVsQupMvNXt6-fqUkg@mail.gmail.com \
--to=yosryahmed@google.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liushixin2@huawei.com \
--cc=lizefan.x@bytedance.com \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=tj@kernel.org \
--cc=wangkefeng.wang@huawei.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