From: "T.J. Mercier" <tjmercier@google.com>
To: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
Yosry Ahmed <yosryahmed@google.com>,
kernel-team@meta.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 6/8] mm: cleanup WORKINGSET_NODES in workingset
Date: Tue, 30 Apr 2024 10:32:05 -0700 [thread overview]
Message-ID: <CABdmKX2-5k7o9P0LDkghr5EFLwe=42aBU9kVfd05+4-Uf41WiA@mail.gmail.com> (raw)
In-Reply-To: <20240430060612.2171650-7-shakeel.butt@linux.dev>
On Mon, Apr 29, 2024 at 11:06 PM Shakeel Butt <shakeel.butt@linux.dev> wrote:
>
> WORKINGSET_NODES is not exposed in the memcg stats and thus there is no
> need to use the memcg specific stat update functions for it. In future
> if we decide to expose WORKINGSET_NODES in the memcg stats, we can
> revert this patch.
>
> Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
> Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Reviewed-by: T.J. Mercier <tjmercier@google.com>
> ---
>
> Changes since v2:
> - N/A
>
> mm/workingset.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/mm/workingset.c b/mm/workingset.c
> index f2a0ecaf708d..c22adb93622a 100644
> --- a/mm/workingset.c
> +++ b/mm/workingset.c
> @@ -618,6 +618,7 @@ struct list_lru shadow_nodes;
> void workingset_update_node(struct xa_node *node)
> {
> struct address_space *mapping;
> + struct page *page = virt_to_page(node);
>
> /*
> * Track non-empty nodes that contain only shadow entries;
> @@ -633,12 +634,12 @@ void workingset_update_node(struct xa_node *node)
> if (node->count && node->count == node->nr_values) {
> if (list_empty(&node->private_list)) {
> list_lru_add_obj(&shadow_nodes, &node->private_list);
> - __inc_lruvec_kmem_state(node, WORKINGSET_NODES);
> + __inc_node_page_state(page, WORKINGSET_NODES);
> }
> } else {
> if (!list_empty(&node->private_list)) {
> list_lru_del_obj(&shadow_nodes, &node->private_list);
> - __dec_lruvec_kmem_state(node, WORKINGSET_NODES);
> + __dec_node_page_state(page, WORKINGSET_NODES);
> }
> }
> }
> @@ -742,7 +743,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item,
> }
>
> list_lru_isolate(lru, item);
> - __dec_lruvec_kmem_state(node, WORKINGSET_NODES);
> + __dec_node_page_state(virt_to_page(node), WORKINGSET_NODES);
>
> spin_unlock(lru_lock);
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2024-04-30 17:32 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 6:06 [PATCH v3 0/8] memcg: reduce memory consumption by memcg stats Shakeel Butt
2024-04-30 6:06 ` [PATCH v3 1/8] memcg: reduce memory size of mem_cgroup_events_index Shakeel Butt
2024-04-30 8:33 ` Yosry Ahmed
2024-04-30 17:29 ` T.J. Mercier
2024-04-30 6:06 ` [PATCH v3 2/8] memcg: dynamically allocate lruvec_stats Shakeel Butt
2024-04-30 17:29 ` T.J. Mercier
2024-04-30 6:06 ` [PATCH v3 3/8] mm: memcg: account memory used for memcg vmstats and lruvec stats Shakeel Butt
2024-04-30 8:34 ` Yosry Ahmed
2024-04-30 17:30 ` T.J. Mercier
2024-04-30 6:06 ` [PATCH v3 4/8] memcg: reduce memory for the lruvec and memcg stats Shakeel Butt
2024-04-30 8:41 ` Yosry Ahmed
2024-04-30 17:37 ` Shakeel Butt
2024-04-30 17:41 ` Yosry Ahmed
2024-04-30 17:49 ` Shakeel Butt
2024-04-30 23:00 ` Shakeel Butt
2024-04-30 23:07 ` Yosry Ahmed
2024-05-01 0:50 ` Johannes Weiner
2024-04-30 17:30 ` T.J. Mercier
2024-04-30 17:45 ` Shakeel Butt
2024-04-30 6:06 ` [PATCH v3 5/8] memcg: cleanup __mod_memcg_lruvec_state Shakeel Butt
2024-04-30 17:31 ` T.J. Mercier
2024-04-30 6:06 ` [PATCH v3 6/8] mm: cleanup WORKINGSET_NODES in workingset Shakeel Butt
2024-04-30 17:32 ` T.J. Mercier [this message]
2024-04-30 6:06 ` [PATCH v3 7/8] memcg: warn for unexpected events and stats Shakeel Butt
2024-04-30 6:06 ` [PATCH v3 8/8] memcg: use proper type for mod_memcg_state Shakeel Butt
2024-04-30 18:09 ` T.J. Mercier
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='CABdmKX2-5k7o9P0LDkghr5EFLwe=42aBU9kVfd05+4-Uf41WiA@mail.gmail.com' \
--to=tjmercier@google.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=yosryahmed@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