From: Andrew Morton <akpm@linux-foundation.org>
To: Bing Jiao <bingjiao@google.com>
Cc: linux-mm@kvack.org, gourry@gourry.net,
"Waiman Long" <longman@redhat.com>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Hocko" <mhocko@kernel.org>,
"Roman Gushchin" <roman.gushchin@linux.dev>,
"Shakeel Butt" <shakeel.butt@linux.dev>,
"Muchun Song" <muchun.song@linux.dev>,
"David Hildenbrand" <david@kernel.org>,
"Lorenzo Stoakes" <lorenzo.stoakes@oracle.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
"Vlastimil Babka" <vbabka@suse.cz>,
"Mike Rapoport" <rppt@kernel.org>,
"Suren Baghdasaryan" <surenb@google.com>,
"Tejun Heo" <tj@kernel.org>, " Michal Koutný " <mkoutny@suse.com>,
"Qi Zheng" <zhengqi.arch@bytedance.com>,
"Axel Rasmussen" <axelrasmussen@google.com>,
"Yuanchu Xie" <yuanchu@google.com>, "Wei Xu" <weixugc@google.com>,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/vmscan: respect mems_effective in demote_folio_list()
Date: Sat, 20 Dec 2025 11:20:44 -0800 [thread overview]
Message-ID: <20251220112044.ee858d2160f819e181598ce1@linux-foundation.org> (raw)
In-Reply-To: <20251220061022.2726028-1-bingjiao@google.com>
On Sat, 20 Dec 2025 06:10:21 +0000 Bing Jiao <bingjiao@google.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@vger.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.
next prev parent reply other threads:[~2025-12-20 19:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-20 6:10 Bing Jiao
2025-12-20 19:20 ` Andrew Morton [this message]
2025-12-22 6:16 ` Bing Jiao
2025-12-21 12:07 ` Gregory Price
2025-12-22 6:28 ` Bing Jiao
2025-12-21 23:36 ` [PATCH v2 0/2] fix demotion targets checks in reclaim/demotion Bing Jiao
2025-12-21 23:36 ` [PATCH v2 1/2] mm/vmscan: respect mems_effective in demote_folio_list() Bing Jiao
2025-12-22 2:38 ` Chen Ridong
2025-12-22 21:56 ` kernel test robot
2025-12-22 22:18 ` kernel test robot
2025-12-21 23:36 ` [PATCH v2 2/2] mm/vmscan: check all allowed targets in can_demote() Bing Jiao
2025-12-22 2:51 ` Chen Ridong
2025-12-22 6:09 ` Bing Jiao
2025-12-22 8:28 ` Chen Ridong
2025-12-23 21:19 ` [PATCH v3] mm/vmscan: fix demotion targets checks in reclaim/demotion Bing Jiao
2025-12-23 21:38 ` Bing Jiao
2025-12-24 1:19 ` Gregory Price
2025-12-26 18:48 ` Bing Jiao
2025-12-24 1:49 ` Chen Ridong
2025-12-26 18:58 ` Bing Jiao
2025-12-26 19:32 ` Waiman Long
2025-12-26 20:24 ` 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=20251220112044.ee858d2160f819e181598ce1@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Liam.Howlett@oracle.com \
--cc=axelrasmussen@google.com \
--cc=bingjiao@google.com \
--cc=cgroups@vger.kernel.org \
--cc=david@kernel.org \
--cc=gourry@gourry.net \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=longman@redhat.com \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=rppt@kernel.org \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=tj@kernel.org \
--cc=vbabka@suse.cz \
--cc=weixugc@google.com \
--cc=yuanchu@google.com \
--cc=zhengqi.arch@bytedance.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