[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ro3uqeyri65voutamqttzipfk7yiya4zv5kdiudcmhacrm6tej@br7ebk2kanf4>
Date: Sat, 19 Apr 2025 11:48:45 -0700
From: Shakeel Butt <shakeel.butt@...ux.dev>
To: Gregory Price <gourry@...rry.net>
Cc: linux-mm@...ck.org, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-team@...a.com, longman@...hat.com, hannes@...xchg.org,
mhocko@...nel.org, roman.gushchin@...ux.dev, muchun.song@...ux.dev, tj@...nel.org,
mkoutny@...e.com, akpm@...ux-foundation.org
Subject: Re: [PATCH v3 2/2] vmscan,cgroup: apply mems_effective to reclaim
On Sat, Apr 19, 2025 at 01:38:24AM -0400, Gregory Price wrote:
>
> +bool cpuset_node_allowed(struct cgroup *cgroup, int nid)
> +{
> + struct cgroup_subsys_state *css;
> + unsigned long flags;
> + struct cpuset *cs;
> + bool allowed;
> +
> + css = cgroup_get_e_css(cgroup, &cpuset_cgrp_subsys);
> + if (!css)
> + return true;
> +
> + cs = container_of(css, struct cpuset, css);
> + spin_lock_irqsave(&callback_lock, flags);
Do we really need callback_lock here? We are not modifying and I am
wondering if simple rcu read lock is enough here (similar to
update_nodemasks_hier() where parent's effective_mems is accessed within
rcu read lock).
> + /* On v1 effective_mems may be empty, simply allow */
> + allowed = node_isset(nid, cs->effective_mems) ||
> + nodes_empty(cs->effective_mems);
> + spin_unlock_irqrestore(&callback_lock, flags);
> + css_put(css);
> + return allowed;
> +}
Powered by blists - more mailing lists