From: Shakeel Butt <shakeel.butt@linux.dev>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
Hugh Dickins <hughd@google.com>,
Yosry Ahmed <yosryahmed@google.com>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org,
Meta kernel team <kernel-team@meta.com>,
Yu Zhao <yuzhao@google.com>
Subject: Re: [PATCH v2] memcg: workingset: remove folio_memcg_rcu usage
Date: Sat, 26 Oct 2024 23:55:14 -0700 [thread overview]
Message-ID: <qrxkf25y6yh6mdzi73kl3cy3kdhihevqb2hgllcjgihghyvrzw@ooy4kzzwc2y7> (raw)
In-Reply-To: <20241026163707.2479526-1-shakeel.butt@linux.dev>
On Sat, Oct 26, 2024 at 09:37:07AM GMT, Shakeel Butt wrote:
> The function workingset_activation() is called from
> folio_mark_accessed() with the guarantee that the given folio can not be
> freed under us in workingset_activation(). In addition, the association
> of the folio and its memcg can not be broken here because charge
> migration is no more. There is no need to use folio_memcg_rcu. Simply
> use folio_memcg_charged() because that is what this function cares
> about.
>
> Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
> Suggested-by: Yu Zhao <yuzhao@google.com>
> ---
> Andrew, please put this patch after charge migration deprecation series.
>
> Changes since v1:
> - Fix for mem_cgroup_disabled(). (Yu Zhao)
>
It seems like folio_memcg_charged() is not defined for CONFIG_MEMCG=n
config option. The following stub should fix the build for such config.
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 89a1e9f10e1b..5502aa8e138e 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -1055,6 +1055,11 @@ static inline struct mem_cgroup *folio_memcg(struct folio *folio)
return NULL;
}
+static inline bool folio_memcg_charged(struct folio *folio)
+{
+ return false;
+}
+
static inline struct mem_cgroup *folio_memcg_check(struct folio *folio)
{
return NULL;
next prev parent reply other threads:[~2024-10-27 6:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-26 16:37 Shakeel Butt
2024-10-27 6:55 ` Shakeel Butt [this message]
2024-10-27 17:33 ` SeongJae Park
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=qrxkf25y6yh6mdzi73kl3cy3kdhihevqb2hgllcjgihghyvrzw@ooy4kzzwc2y7 \
--to=shakeel.butt@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--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=yosryahmed@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