lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <qrxkf25y6yh6mdzi73kl3cy3kdhihevqb2hgllcjgihghyvrzw@ooy4kzzwc2y7>
Date: Sat, 26 Oct 2024 23:55:14 -0700
From: Shakeel Butt <shakeel.butt@...ux.dev>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Johannes Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...nel.org>, 
	Roman Gushchin <roman.gushchin@...ux.dev>, Muchun Song <muchun.song@...ux.dev>, 
	Hugh Dickins <hughd@...gle.com>, Yosry Ahmed <yosryahmed@...gle.com>, linux-mm@...ck.org, 
	cgroups@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Meta kernel team <kernel-team@...a.com>, Yu Zhao <yuzhao@...gle.com>
Subject: Re: [PATCH v2] memcg: workingset: remove folio_memcg_rcu usage

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@...ux.dev>
> Suggested-by: Yu Zhao <yuzhao@...gle.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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ