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: <aUjgt4EdBv4UyrTM@google.com>
Date: Mon, 22 Dec 2025 06:09:59 +0000
From: Bing Jiao <bingjiao@...gle.com>
To: Chen Ridong <chenridong@...weicloud.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	stable@...r.kernel.org, akpm@...ux-foundation.org,
	gourry@...rry.net, longman@...hat.com, hannes@...xchg.org,
	mhocko@...nel.org, roman.gushchin@...ux.dev, shakeel.butt@...ux.dev,
	muchun.song@...ux.dev, tj@...nel.org, mkoutny@...e.com,
	david@...nel.org, zhengqi.arch@...edance.com,
	lorenzo.stoakes@...cle.com, axelrasmussen@...gle.com,
	yuanchu@...gle.com, weixugc@...gle.com, cgroups@...r.kernel.org
Subject: Re: [PATCH v2 2/2] mm/vmscan: check all allowed targets in
 can_demote()

On Mon, Dec 22, 2025 at 10:51:49AM +0800, Chen Ridong wrote:
>
>
> On 2025/12/22 7:36, Bing Jiao wrote:
> > -void cpuset_node_filter_allowed(struct cgroup *cgroup, nodemask_t *mask)
> > -{
> > -	struct cgroup_subsys_state *css;
> > -	struct cpuset *cs;
> > -
> > -	if (!cpuset_v2())
> > -		return;
> > -
> > -	css = cgroup_get_e_css(cgroup, &cpuset_cgrp_subsys);
> > -	if (!css)
> > -		return;
> > -
> > -	/* Follows the same assumption in cpuset_node_allowed() */
> > -	cs = container_of(css, struct cpuset, css);
> >  	nodes_and(*mask, *mask, cs->effective_mems);
> >  	css_put(css);
> >  }
>
> Oh, I see you merged these two functions here.
>
> However, I think cpuset_get_mem_allowed would be more versatile in general use.
>
> You can then check whether the returned nodemask intersects with your target mask. In the future,
> there may be scenarios where users simply want to retrieve the effective masks directly.
>

Hi Ridong, thank you for the suggestions.

I agree that returning a nodemask would provide greater versatility.

I think cpuset_get_mem_allowed_relax() would be a better name,
since we do not need the locking and online mem guarantees
compared to an similar function cpuset_mems_allowed().

Best,
Bing

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ