From: Gregory Price <gourry@gourry.net>
To: Waiman Long <llong@redhat.com>
Cc: cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, kernel-team@meta.com,
tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com,
mhocko@kernel.org, roman.gushchin@linux.dev,
shakeel.butt@linux.dev, muchun.song@linux.dev,
akpm@linux-foundation.org
Subject: Re: [PATCH v2 2/2] vmscan,cgroup: apply mems_effective to reclaim
Date: Fri, 18 Apr 2025 23:47:30 -0400 [thread overview]
Message-ID: <aAMc0ux6_jEhEskd@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <162f1ae4-2adf-4133-8de4-20f240e5469e@redhat.com>
On Fri, Apr 18, 2025 at 10:06:40PM -0400, Waiman Long 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);
> > + /* At least one parent must have a valid node list */
> > + while (nodes_empty(cs->effective_mems))
> > + cs = parent_cs(cs);
>
> For cgroup v2, effective_mems should always be set and walking up the tree
> isn't necessary. For v1, it can be empty, but memory cgroup and cpuset are
> unlikely in the same hierarchy.
>
Hm, do i need different paths here for v1 vs v2 then? Or is it
sufficient to simply return true if effective_mems is empty (which
implies v1)?
Thanks,
~Gregory
next prev parent reply other threads:[~2025-04-19 3:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 3:13 [PATCH 1/2] cpuset: rename cpuset_node_allowed to cpuset_current_node_allowed Gregory Price
2025-04-18 3:13 ` [PATCH v2 2/2] vmscan,cgroup: apply mems_effective to reclaim Gregory Price
2025-04-19 2:06 ` Waiman Long
2025-04-19 3:47 ` Gregory Price [this message]
2025-04-19 3:53 ` Waiman Long
2025-04-19 3:06 ` Tejun Heo
2025-04-19 3:27 ` Gregory Price
2025-04-19 3:41 ` Gregory Price
2025-04-19 3:47 ` Waiman Long
2025-04-19 1:59 ` [PATCH 1/2] cpuset: rename cpuset_node_allowed to cpuset_current_node_allowed Waiman Long
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=aAMc0ux6_jEhEskd@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=llong@redhat.com \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=tj@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.