[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251220112044.ee858d2160f819e181598ce1@linux-foundation.org>
Date: Sat, 20 Dec 2025 11:20:44 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Bing Jiao <bingjiao@...gle.com>
Cc: linux-mm@...ck.org, gourry@...rry.net, Waiman Long <longman@...hat.com>,
Johannes Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>, Shakeel Butt
<shakeel.butt@...ux.dev>, Muchun Song <muchun.song@...ux.dev>, David
Hildenbrand <david@...nel.org>, Lorenzo Stoakes
<lorenzo.stoakes@...cle.com>, "Liam R. Howlett" <Liam.Howlett@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>, Suren
Baghdasaryan <surenb@...gle.com>, Tejun Heo <tj@...nel.org>,
"Michal Koutný" <mkoutny@...e.com>, Qi Zheng
<zhengqi.arch@...edance.com>, Axel Rasmussen <axelrasmussen@...gle.com>,
Yuanchu Xie <yuanchu@...gle.com>, Wei Xu <weixugc@...gle.com>,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/vmscan: respect mems_effective in
demote_folio_list()
On Sat, 20 Dec 2025 06:10:21 +0000 Bing Jiao <bingjiao@...gle.com> wrote:
> Commit 7d709f49babc ("vmscan,cgroup: apply mems_effective to reclaim")
> introduces the cpuset.mems_effective check and applies it to
> can_demote().
So we'll want
Fixes: 7d709f49babc ("vmscan,cgroup: apply mems_effective to reclaim")
in the changelog.
> However, it does not apply this check in
> demote_folio_list(), which leads to situations where pages are demoted
> to nodes that are explicitly excluded from the task's cpuset.mems.
>
> To address the issue that demotion targets do not respect
> cpuset.mem_effective in demote_folio_list(), implement a new function
> get_demotion_targets(), which returns a preferred demotion target
> and all allowed (fallback) nodes against mems_effective,
> and update demote_folio_list() and can_demote() accordingly to
> use get_demotion_targets().
7d709f49babc fist appeared in 6.16, so we must decide whether to
backport this fix into -stable kernels, via a Cc:
<stable@...r.kernel.org>.
To make this decision it's best to have a clear understanding of the
userspace visible impact of the bug. Putting pages into improper nodes
is undesirable, but how much does it affect real-world workloads?
Please include in the changelog some words about this to help others
understand why we should backport the fix.
> Furthermore, update some supporting functions:
> - Add a parameter for next_demotion_node() to return a copy of
> node_demotion[]->preferred, allowing get_demotion_targets()
> to select the next-best node for demotion.
> - Change the parameters for cpuset_node_allowed() and
> mem_cgroup_node_allowed() from nid to nodemask * to allow
> for direct logic-and operations with mems_effective.
If we do decide to backport the fix into earlier kernels then it's best
to keep the patch as small and as simple as possible. So non-bugfix
changes such as these are best made via a second followup patch which
can be merged via the normal -rc staging process.
Powered by blists - more mailing lists