From: Vlastimil Babka <vbabka@suse.cz>
To: "Yury Norov" <ynorov@nvidia.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Alistair Popple" <apopple@nvidia.com>,
"Byungchul Park" <byungchul@sk.com>,
"David Hildenbrand" <david@kernel.org>,
"Gregory Price" <gourry@gourry.net>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Joshua Hahn" <joshua.hahnjy@gmail.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
"Lorenzo Stoakes" <lorenzo.stoakes@oracle.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Michal Hocko" <mhocko@suse.com>,
"Michal Koutný" <mkoutny@suse.com>,
"Mike Rapoport" <rppt@kernel.org>, "Rakie Kim" <rakie.kim@sk.com>,
"Suren Baghdasaryan" <surenb@google.com>,
"Tejun Heo" <tj@kernel.org>, "Waiman Long" <longman@redhat.com>,
"Ying Huang" <ying.huang@linux.alibaba.com>,
"Zi Yan" <ziy@nvidia.com>,
cgroups@vger.kernel.org
Cc: Yury Norov <yury.norov@gmail.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] mm: use nodes_and() return value to simplify client code
Date: Thu, 15 Jan 2026 18:22:31 +0100 [thread overview]
Message-ID: <88beb165-cb8a-4c13-af96-2a7e39653f17@suse.cz> (raw)
In-Reply-To: <20260114172217.861204-3-ynorov@nvidia.com>
On 1/14/26 18:22, Yury Norov wrote:
> establish_demotion_targets() and kernel_migrate_pages() call
> node_empty() immediately after calling nodes_and(). Now that
> nodes_and() return false if nodemask is empty, drop the latter.
>
> Signed-off-by: Yury Norov <ynorov@nvidia.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
> ---
> mm/memory-tiers.c | 3 +--
> mm/mempolicy.c | 3 +--
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
> index 864811fff409..2cbef49a587d 100644
> --- a/mm/memory-tiers.c
> +++ b/mm/memory-tiers.c
> @@ -475,8 +475,7 @@ static void establish_demotion_targets(void)
> */
> list_for_each_entry_reverse(memtier, &memory_tiers, list) {
> tier_nodes = get_memtier_nodemask(memtier);
> - nodes_and(tier_nodes, node_states[N_CPU], tier_nodes);
> - if (!nodes_empty(tier_nodes)) {
> + if (nodes_and(tier_nodes, node_states[N_CPU], tier_nodes)) {
> /*
> * abstract distance below the max value of this memtier
> * is considered toptier.
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 68a98ba57882..92a0bf7619a2 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -1909,8 +1909,7 @@ static int kernel_migrate_pages(pid_t pid, unsigned long maxnode,
> }
>
> task_nodes = cpuset_mems_allowed(current);
> - nodes_and(*new, *new, task_nodes);
> - if (nodes_empty(*new))
> + if (!nodes_and(*new, *new, task_nodes))
> goto out_put;
>
> err = security_task_movememory(task);
next prev parent reply other threads:[~2026-01-15 17:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 17:22 [PATCH 0/3] nodemask: align nodes_and{,not} with underlying bitmap ops Yury Norov
2026-01-14 17:22 ` [PATCH 1/3] nodemask: propagate boolean for nodes_and{,not} Yury Norov
2026-01-14 17:56 ` Gregory Price
2026-01-15 20:32 ` David Hildenbrand (Red Hat)
2026-01-14 17:22 ` [PATCH 2/3] mm: use nodes_and() return value to simplify client code Yury Norov
2026-01-14 17:56 ` Gregory Price
2026-01-15 17:22 ` Vlastimil Babka [this message]
2026-01-15 20:32 ` David Hildenbrand (Red Hat)
2026-01-14 17:22 ` [PATCH 3/3] cgroup: use nodes_and() output where appropriate Yury Norov
2026-01-14 18:00 ` Gregory Price
2026-01-14 22:13 ` Michal Koutný
2026-01-14 22:33 ` Waiman Long
2026-01-15 0:52 ` Chen Ridong
2026-01-16 7:59 ` Tejun Heo
2026-01-14 19:37 ` [PATCH 0/3] nodemask: align nodes_and{,not} with underlying bitmap ops Joshua Hahn
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=88beb165-cb8a-4c13-af96-2a7e39653f17@suse.cz \
--to=vbabka@suse.cz \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=byungchul@sk.com \
--cc=cgroups@vger.kernel.org \
--cc=david@kernel.org \
--cc=gourry@gourry.net \
--cc=hannes@cmpxchg.org \
--cc=joshua.hahnjy@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@rasmusvillemoes.dk \
--cc=longman@redhat.com \
--cc=lorenzo.stoakes@oracle.com \
--cc=matthew.brost@intel.com \
--cc=mhocko@suse.com \
--cc=mkoutny@suse.com \
--cc=rakie.kim@sk.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=tj@kernel.org \
--cc=ying.huang@linux.alibaba.com \
--cc=ynorov@nvidia.com \
--cc=yury.norov@gmail.com \
--cc=ziy@nvidia.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox