Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: use nodes_and() return value to simplify client code

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.

Link: https://lkml.kernel.org/r/20260114172217.861204-3-ynorov@nvidia.com
Signed-off-by: Yury Norov <ynorov@nvidia.com>
Reviewed-by: Gregory Price <gourry@gourry.net>
Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: "Huang, Ying" <ying.huang@linux.alibaba.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Mathew Brost <matthew.brost@intel.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Waiman Long <longman@redhat.com>
Cc: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Yury Norov and committed by
Andrew Morton
386781df cbc064e7

+2 -4
+1 -2
mm/memory-tiers.c
··· 475 475 */ 476 476 list_for_each_entry_reverse(memtier, &memory_tiers, list) { 477 477 tier_nodes = get_memtier_nodemask(memtier); 478 - nodes_and(tier_nodes, node_states[N_CPU], tier_nodes); 479 - if (!nodes_empty(tier_nodes)) { 478 + if (nodes_and(tier_nodes, node_states[N_CPU], tier_nodes)) { 480 479 /* 481 480 * abstract distance below the max value of this memtier 482 481 * is considered toptier.
+1 -2
mm/mempolicy.c
··· 1909 1909 } 1910 1910 1911 1911 task_nodes = cpuset_mems_allowed(current); 1912 - nodes_and(*new, *new, task_nodes); 1913 - if (nodes_empty(*new)) 1912 + if (!nodes_and(*new, *new, task_nodes)) 1914 1913 goto out_put; 1915 1914 1916 1915 err = security_task_movememory(task);