* [folded-merged] mm-list_lru-dont-use-a-new-memcgs-lists-for-an-offline-memcg-fix.patch removed from -mm tree
@ 2026-11-17 20:34 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-11-17 20:34 UTC (permalink / raw)
To: mm-commits, shakeel.butt, roman.gushchin, qi.zheng, muchun.song,
mhocko, mason, hannes, david, david, akpm
The quilt patch titled
Subject: mm/list_lru: verify memcg owner before skipping allocation
has been removed from the -mm tree. Its filename was
mm-list_lru-dont-use-a-new-memcgs-lists-for-an-offline-memcg-fix.patch
This patch was dropped because it was folded into mm-list_lru-dont-use-a-new-memcgs-lists-for-an-offline-memcg.patch
------------------------------------------------------
From: Andrew Morton <akpm@linux-foundation.org>
Subject: mm/list_lru: verify memcg owner before skipping allocation
Date: Thu, 12 Nov 2026 16:08:59 -0800
list_lru_from_memcg() rejects an entry at a reused kmemcg_id when it
belongs to another memcg. memcg_list_lru_allocated() still treats any
entry at that index as a list for the requested memcg. Its callers can
therefore skip the allocation of that memcg's ancestor lists.
With child C and parent P's lists both unallocated, a reader can retain C
while it is offlined. If an unrelated new memcg reuses C's ID and
allocates its own list, the reader mistakes that entry for C's and skips
allocation of P's list. Once the folio's objcg points to P,
deferred_split_folio() can add it to the root list. If P later gets a
list, unqueue locks P's list while unlinking the folio from root's list,
which can corrupt that list under concurrent operations.
Require the entry to belong to the requested memcg before returning true.
Hold RCU over the XArray load and owner comparison because this helper is
also called outside the folio fast path's RCU section.
Link: https://lore.kernel.org/20261112161502.18d9d72c0139b8f69bb88ff4@linux-foundation.org
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Reported-by: <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/sashiko-outbox-211977@kernel.org
Cc: Chris Mason <mason@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Qi Zheng <qi.zheng@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
mm/list_lru.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
--- a/mm/list_lru.c~mm-list_lru-dont-use-a-new-memcgs-lists-for-an-offline-memcg-fix
+++ a/mm/list_lru.c
@@ -568,9 +568,19 @@ void memcg_reparent_list_lrus(struct mem
static inline bool memcg_list_lru_allocated(struct mem_cgroup *memcg,
struct list_lru *lru)
{
+ struct list_lru_memcg *mlru;
+ bool allocated;
int idx = memcg->kmemcg_id;
- return idx < 0 || xa_load(&lru->xa, idx);
+ if (idx < 0)
+ return true;
+
+ rcu_read_lock();
+ mlru = xa_load(&lru->xa, idx);
+ allocated = mlru && mlru->memcg == memcg;
+ rcu_read_unlock();
+
+ return allocated;
}
static int __memcg_list_lru_alloc(struct mem_cgroup *memcg,
_
Patches currently in -mm which might be from akpm@linux-foundation.org are
mm-list_lru-dont-use-a-new-memcgs-lists-for-an-offline-memcg.patch
maintainers-add-page_exth-to-memory-management-page-allocator.patch
shmem-consume-the-reserved-xattr-space-despite-remount.patch
selftests-mm-check-madv_cold-and-madv_pageout-on-partly-advised-thps-fix.patch
alloc_tag-introduce-ioctls-to-toggle-allocation-tracepoints-fix-fix.patch
alloc_tag-introduce-ioctls-to-toggle-allocation-tracepoints-fix.patch
selftests-mm-add-uffdio_move-huge-zeropage-pmd-regression-test-fix.patch
selftests-mm-allocate-nr_pages-based-on-pmd-size-for-uffd-pmd_move-tests-fix.patch
selftests-mm-retain-move-pmd-coverage-and-verify-huge-pmds.patch
lib-test_xarray-check-unused-spare-node-after-range-creation.patch
ipc-msg-clamp-negative-msg_info-usage-counts.patch
squashfs-fix-leaked-page-locks-when-page-actor-allocation-fails-fix.patch
squashfs-sanity-check-directory-metadata-block-location-fix.patch
squashfs-fix-variables-in-directory-code-and-add-more-sanity-checks-fix.patch
ocfs2-skip-network-flush-when-no-domain-handlers-are-registered.patch
selftests-ptrace-check-that-ptrace_set_syscall_info-rejects-invalid-error-values-fix.patch
drivers-media-v4l2-core-v4l2-vp9c-reduce-inlining.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-17 20:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 20:34 [folded-merged] mm-list_lru-dont-use-a-new-memcgs-lists-for-an-offline-memcg-fix.patch removed from -mm tree Andrew Morton
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.