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: <aTkxOJtONChaM8o5@tiehlicka>
Date: Wed, 10 Dec 2025 09:37:12 +0100
From: Michal Hocko <mhocko@...e.com>
To: Chen Ridong <chenridong@...weicloud.com>
Cc: hannes@...xchg.org, roman.gushchin@...ux.dev, shakeel.butt@...ux.dev,
	muchun.song@...ux.dev, akpm@...ux-foundation.org,
	axelrasmussen@...gle.com, yuanchu@...gle.com, weixugc@...gle.com,
	david@...nel.org, zhengqi.arch@...edance.com,
	lorenzo.stoakes@...cle.com, cgroups@...r.kernel.org,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	lujialin4@...wei.com
Subject: Re: [PATCH -next v2 2/2] memcg: remove mem_cgroup_size()

On Wed 10-12-25 16:31:37, Chen Ridong wrote:
> 
> 
> On 2025/12/10 16:05, Michal Hocko wrote:
[...]
> >> diff --git a/mm/vmscan.c b/mm/vmscan.c
> >> index 670fe9fae5ba..fe48d0376e7c 100644
> >> --- a/mm/vmscan.c
> >> +++ b/mm/vmscan.c
> >> @@ -2451,6 +2451,7 @@ static inline void calculate_pressure_balance(struct scan_control *sc,
> >>  static unsigned long apply_proportional_protection(struct mem_cgroup *memcg,
> >>  		struct scan_control *sc, unsigned long scan)
> >>  {
> >> +#ifdef CONFIG_MEMCG
> >>  	unsigned long min, low;
> >>  
> >>  	mem_cgroup_protection(sc->target_mem_cgroup, memcg, &min, &low);
> > [...]
> >> @@ -2508,6 +2509,7 @@ static unsigned long apply_proportional_protection(struct mem_cgroup *memcg,
> >>  		 */
> >>  		scan = max(scan, SWAP_CLUSTER_MAX);
> >>  	}
> >> +#endif
> >>  	return scan;
> >>  }
> > 
> > This returns a random garbage for !CONFIG_MEMCG, doesn't it?
> > 
> 
> This returns what was passed as input. This means the scan behavior remains unchanged when memcg is
> disabled. When memcg is enabled, the scan amount may be proportionally scaled.

Right you are. My bad. Sorry for the confusion.
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ