* FAILED: patch "[PATCH] mm/gup: fix always draining LRU caches in" failed to apply to 6.12-stable tree
@ 2026-09-03 11:28 gregkh
2026-09-03 15:00 ` [PATCH 6.12.y 1/3] mm: move hugetlb specific things in folio to page[3] Sasha Levin
0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2026-09-03 11:28 UTC (permalink / raw)
To: david, ackerleytng, akpm, hughd, jgg, jhubbard, kas, peterx,
stable; +Cc: stable
The patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 078e1a0fc41a42baaf113383b52dab8874c0b967
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026090322-cucumber-clumsily-daf5@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 078e1a0fc41a42baaf113383b52dab8874c0b967 Mon Sep 17 00:00:00 2001
From: "David Hildenbrand (Arm)" <david@kernel.org>
Date: Fri, 31 Jul 2026 22:27:53 +0200
Subject: [PATCH] mm/gup: fix always draining LRU caches in
collect_longterm_unpinnable_folios()
folio_may_be_lru_cached() is currently only true for small folios, and
for small folios FOLL_PIN adds GUP_PIN_COUNTING_BIAS references instead
of 1 in try_grab_folio()/try_grab_folio_fast().
Consequently, our
folio_ref_count(folio) != folio_expected_ref_count(folio) + 1
check in collect_longterm_unpinnable_folios() will currently always
identify "reference mismatch" and first drain the local LRU cache to then
drain the LRU cache on all CPUs, as collect_longterm_unpinnable_folios()
is really called after pinning the folios with FOLL_PIN.
Add a comment because the current code is not quite intuitive: we used to
drain only to make sure the folio_isolate_lru() would succeed. But then we
also started draining to make later migration more reliable.
We'll refactor that code soon a bit, to also make it usable in other
context where we really want to remove any references from LRU caches.
Let's add CC stable, because having an easy way for excessive LRU cache
draining on all CPUs does not sound right. In common scenarios we
don't expect to ever have to drain.
Link: https://lore.kernel.org/20260731-check_and_migrate_movable_folios-v1-1-e0002d7b791e@kernel.org
Fixes: 98c6d259319e ("mm/gup: check ref_count instead of lru before migration")
Fixes: a09a8a1fbb37 ("mm/gup: local lru_add_drain() to avoid lru_add_drain_all()")
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Ackerley Tng <ackerleytng@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
diff --git a/mm/gup.c b/mm/gup.c
index 8ea3de60e82d..bce275c7dbb6 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -2273,6 +2273,7 @@ static unsigned long collect_longterm_unpinnable_folios(
for (folio = pofs_get_folio(pofs, i); folio;
folio = pofs_next_folio(folio, pofs, &i)) {
+ const int pin_refs = folio_has_pincount(folio) ? 1 : GUP_PIN_COUNTING_BIAS;
if (folio_is_longterm_pinnable(folio))
continue;
@@ -2287,15 +2288,20 @@ static unsigned long collect_longterm_unpinnable_folios(
continue;
}
+ /*
+ * We drain not only to make the folio_isolate_lru() succeed,
+ * but also to remove any other folio references from LRU
+ * caches.
+ */
if (drained == 0 && folio_may_be_lru_cached(folio) &&
folio_ref_count(folio) !=
- folio_expected_ref_count(folio) + 1) {
+ folio_expected_ref_count(folio) + pin_refs) {
lru_add_drain();
drained = 1;
}
if (drained == 1 && folio_may_be_lru_cached(folio) &&
folio_ref_count(folio) !=
- folio_expected_ref_count(folio) + 1) {
+ folio_expected_ref_count(folio) + pin_refs) {
lru_add_drain_all();
drained = 2;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 6.12.y 1/3] mm: move hugetlb specific things in folio to page[3] 2026-09-03 11:28 FAILED: patch "[PATCH] mm/gup: fix always draining LRU caches in" failed to apply to 6.12-stable tree gregkh @ 2026-09-03 15:00 ` Sasha Levin 2026-09-03 15:00 ` [PATCH 6.12.y 2/3] mm: move _pincount in folio to page[2] on 32bit Sasha Levin 2026-09-03 15:00 ` [PATCH 6.12.y 3/3] mm/gup: fix always draining LRU caches in collect_longterm_unpinnable_folios() Sasha Levin 0 siblings, 2 replies; 5+ messages in thread From: Sasha Levin @ 2026-09-03 15:00 UTC (permalink / raw) To: stable Cc: David Hildenbrand, Andy Lutomirks^H^Hski, Borislav Betkov, Dave Hansen, Ingo Molnar, Jann Horn, Johannes Weiner, Jonathan Corbet, Kirill A. Shutemov, Lance Yang, Liam Howlett, Lorenzo Stoakes, Matthew Wilcow (Oracle), Michal Koutn, Muchun Song, tejun heo, Thomas Gleixner, Vlastimil Babka, Zefan Li, Andrew Morton, Sasha Levin From: David Hildenbrand <david@redhat.com> [ Upstream commit 4eeec8c89a0c4a8c20fb13a4e7093cc8efce383d ] Let's just move the hugetlb specific stuff to a separate page, and stop letting it overlay other fields for now. This frees up some space in page[2], which we will use on 32bit to free up some space in page[1]. While we could move these things to page[3] instead, it's cleaner to just move the hugetlb specific things out of the way and pack the core-folio stuff as tight as possible. ... and we can minimize the work required in dump_folio. We can now avoid re-initializing &folio->_deferred_list in hugetlb code. Hopefully dynamically allocating "strut folio" in the future will further clean this up. Link: https://lkml.kernel.org/r/20250303163014.1128035-5-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Cc: Andy Lutomirks^H^Hski <luto@kernel.org> Cc: Borislav Betkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jann Horn <jannh@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Lance Yang <ioworker0@gmail.com> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Matthew Wilcow (Oracle) <willy@infradead.org> Cc: Michal Koutn <mkoutny@suse.com> Cc: Muchun Song <muchun.song@linux.dev> Cc: tejun heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Zefan Li <lizefan.x@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Stable-dep-of: 078e1a0fc41a ("mm/gup: fix always draining LRU caches in collect_longterm_unpinnable_folios()") Signed-off-by: Sasha Levin <sashal@kernel.org> --- include/linux/mm_types.h | 27 +++++++++++++++++---------- mm/hugetlb.c | 1 - mm/page_alloc.c | 5 +++++ 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 2113f7da182c6..08ae1793f29d9 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -382,20 +382,23 @@ struct folio { unsigned long _flags_2; unsigned long _head_2; /* public: */ - void *_hugetlb_subpool; - void *_hugetlb_cgroup; - void *_hugetlb_cgroup_rsvd; - void *_hugetlb_hwpoison; + struct list_head _deferred_list; /* private: the union with struct page is transitional */ }; + struct page __page_2; + }; + union { struct { - unsigned long _flags_2a; - unsigned long _head_2a; + unsigned long _flags_3; + unsigned long _head_3; /* public: */ - struct list_head _deferred_list; + void *_hugetlb_subpool; + void *_hugetlb_cgroup; + void *_hugetlb_cgroup_rsvd; + void *_hugetlb_hwpoison; /* private: the union with struct page is transitional */ }; - struct page __page_2; + struct page __page_3; }; }; @@ -430,8 +433,12 @@ FOLIO_MATCH(compound_head, _head_1); offsetof(struct page, pg) + 2 * sizeof(struct page)) FOLIO_MATCH(flags, _flags_2); FOLIO_MATCH(compound_head, _head_2); -FOLIO_MATCH(flags, _flags_2a); -FOLIO_MATCH(compound_head, _head_2a); +#undef FOLIO_MATCH +#define FOLIO_MATCH(pg, fl) \ + static_assert(offsetof(struct folio, fl) == \ + offsetof(struct page, pg) + 3 * sizeof(struct page)) +FOLIO_MATCH(flags, _flags_3); +FOLIO_MATCH(compound_head, _head_3); #undef FOLIO_MATCH /** diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e910ed0c43d0b..4e4f3587731ed 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1702,7 +1702,6 @@ static void __update_and_free_hugetlb_folio(struct hstate *h, folio_ref_unfreeze(folio, 1); - INIT_LIST_HEAD(&folio->_deferred_list); hugetlb_free_folio(folio); } diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 259249a37faf0..d8209a512019e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1005,6 +1005,11 @@ static int free_tail_page_prepare(struct page *head_page, struct page *page) goto out; } break; + case 3: + /* the third tail page: hugetlb specifics overlap ->mappings */ + if (IS_ENABLED(CONFIG_HUGETLB_PAGE)) + break; + fallthrough; default: if (page->mapping != TAIL_MAPPING) { bad_page(page, "corrupted mapping in tail page"); -- 2.53.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 6.12.y 2/3] mm: move _pincount in folio to page[2] on 32bit 2026-09-03 15:00 ` [PATCH 6.12.y 1/3] mm: move hugetlb specific things in folio to page[3] Sasha Levin @ 2026-09-03 15:00 ` Sasha Levin 2026-09-03 15:00 ` [PATCH 6.12.y 3/3] mm/gup: fix always draining LRU caches in collect_longterm_unpinnable_folios() Sasha Levin 1 sibling, 0 replies; 5+ messages in thread From: Sasha Levin @ 2026-09-03 15:00 UTC (permalink / raw) To: stable Cc: David Hildenbrand, Andy Lutomirks^H^Hski, Borislav Betkov, Dave Hansen, Ingo Molnar, Jann Horn, Johannes Weiner, Jonathan Corbet, Kirill A. Shutemov, Lance Yang, Liam Howlett, Lorenzo Stoakes, Matthew Wilcow (Oracle), Michal Koutn, Muchun Song, tejun heo, Thomas Gleixner, Vlastimil Babka, Zefan Li, Andrew Morton, Sasha Levin From: David Hildenbrand <david@redhat.com> [ Upstream commit 31a31da8a6187f1e5448ec73222e01d7d3fed4aa ] Let's free up some space on 32bit in page[1] by moving the _pincount to page[2]. For order-1 folios (never anon folios!) on 32bit, we will now also use the GUP_PIN_COUNTING_BIAS approach. A fully-mapped order-1 folio requires 2 references. With GUP_PIN_COUNTING_BIAS being 1024, we'd detect such folios as "maybe pinned" with 512 full mappings, instead of 1024 for order-0. As anon folios are out of the picture (which are the most relevant users of checking for pinnings on *mapped* pages) and we are talking about 32bit, this is not expected to cause any trouble. In __dump_page(), copy one additional folio page if we detect a folio with an order > 1, so we can dump the pincount on order > 1 folios reliably. Note that THPs on 32bit are not particularly common (and we don't care too much about performance), but we want to keep it working reliably, because likely we want to use large folios there as well in the future, independent of PMD leaf support. Once we dynamically allocate "struct folio", fortunately the 32bit specifics will likely go away again; even small folios could then have a pincount and folio_has_pincount() would essentially always return "true". Link: https://lkml.kernel.org/r/20250303163014.1128035-6-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Cc: Andy Lutomirks^H^Hski <luto@kernel.org> Cc: Borislav Betkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jann Horn <jannh@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Lance Yang <ioworker0@gmail.com> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Matthew Wilcow (Oracle) <willy@infradead.org> Cc: Michal Koutn <mkoutny@suse.com> Cc: Muchun Song <muchun.song@linux.dev> Cc: tejun heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Zefan Li <lizefan.x@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> [ sashal: Reduced backport -- upstream 31a31da8a6187 touches 6 file(s), this backport carries 1. Not backported here: include/linux/mm_types.h mm/debug.c mm/gup.c mm/internal.h mm/page_alloc.c This note is generated from the file lists only; see the resolution record for the reasoning. ] Stable-dep-of: 078e1a0fc41a ("mm/gup: fix always draining LRU caches in collect_longterm_unpinnable_folios()") Signed-off-by: Sasha Levin <sashal@kernel.org> --- include/linux/mm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index ad38239294640..1728dc3356089 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1905,6 +1905,8 @@ static inline struct folio *pfn_folio(unsigned long pfn) return page_folio(pfn_to_page(pfn)); } +#define folio_has_pincount(folio) folio_test_large(folio) + /** * folio_maybe_dma_pinned - Report if a folio may be pinned for DMA. * @folio: The folio. -- 2.53.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 6.12.y 3/3] mm/gup: fix always draining LRU caches in collect_longterm_unpinnable_folios() 2026-09-03 15:00 ` [PATCH 6.12.y 1/3] mm: move hugetlb specific things in folio to page[3] Sasha Levin 2026-09-03 15:00 ` [PATCH 6.12.y 2/3] mm: move _pincount in folio to page[2] on 32bit Sasha Levin @ 2026-09-03 15:00 ` Sasha Levin 2026-09-03 17:46 ` Hugh Dickins 1 sibling, 1 reply; 5+ messages in thread From: Sasha Levin @ 2026-09-03 15:00 UTC (permalink / raw) To: stable Cc: David Hildenbrand (Arm), Hugh Dickins, Ackerley Tng, Jason Gunthorpe, John Hubbard, Kiryl Shutsemau, Peter Xu, Andrew Morton, Sasha Levin From: "David Hildenbrand (Arm)" <david@kernel.org> [ Upstream commit 078e1a0fc41a42baaf113383b52dab8874c0b967 ] folio_may_be_lru_cached() is currently only true for small folios, and for small folios FOLL_PIN adds GUP_PIN_COUNTING_BIAS references instead of 1 in try_grab_folio()/try_grab_folio_fast(). Consequently, our folio_ref_count(folio) != folio_expected_ref_count(folio) + 1 check in collect_longterm_unpinnable_folios() will currently always identify "reference mismatch" and first drain the local LRU cache to then drain the LRU cache on all CPUs, as collect_longterm_unpinnable_folios() is really called after pinning the folios with FOLL_PIN. Add a comment because the current code is not quite intuitive: we used to drain only to make sure the folio_isolate_lru() would succeed. But then we also started draining to make later migration more reliable. We'll refactor that code soon a bit, to also make it usable in other context where we really want to remove any references from LRU caches. Let's add CC stable, because having an easy way for excessive LRU cache draining on all CPUs does not sound right. In common scenarios we don't expect to ever have to drain. Link: https://lore.kernel.org/20260731-check_and_migrate_movable_folios-v1-1-e0002d7b791e@kernel.org Fixes: 98c6d259319e ("mm/gup: check ref_count instead of lru before migration") Fixes: a09a8a1fbb37 ("mm/gup: local lru_add_drain() to avoid lru_add_drain_all()") Signed-off-by: David Hildenbrand (Arm) <david@kernel.org> Acked-by: Hugh Dickins <hughd@google.com> Cc: Ackerley Tng <ackerleytng@google.com> Cc: Jason Gunthorpe <jgg@ziepe.ca> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Kiryl Shutsemau <kas@kernel.org> Cc: Peter Xu <peterx@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org> --- mm/gup.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 937865ecfae00..810a4c32ee870 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2362,6 +2362,7 @@ static unsigned long collect_longterm_unpinnable_folios( for (folio = pofs_get_folio(pofs, i); folio; folio = pofs_next_folio(folio, pofs, &i)) { + const int pin_refs = folio_has_pincount(folio) ? 1 : GUP_PIN_COUNTING_BIAS; if (folio_is_longterm_pinnable(folio)) continue; @@ -2376,15 +2377,20 @@ static unsigned long collect_longterm_unpinnable_folios( continue; } + /* + * We drain not only to make the folio_isolate_lru() succeed, + * but also to remove any other folio references from LRU + * caches. + */ if (drained == 0 && folio_may_be_lru_cached(folio) && folio_ref_count(folio) != - folio_expected_ref_count(folio) + 1) { + folio_expected_ref_count(folio) + pin_refs) { lru_add_drain(); drained = 1; } if (drained == 1 && folio_may_be_lru_cached(folio) && folio_ref_count(folio) != - folio_expected_ref_count(folio) + 1) { + folio_expected_ref_count(folio) + pin_refs) { lru_add_drain_all(); drained = 2; } -- 2.53.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 6.12.y 3/3] mm/gup: fix always draining LRU caches in collect_longterm_unpinnable_folios() 2026-09-03 15:00 ` [PATCH 6.12.y 3/3] mm/gup: fix always draining LRU caches in collect_longterm_unpinnable_folios() Sasha Levin @ 2026-09-03 17:46 ` Hugh Dickins 0 siblings, 0 replies; 5+ messages in thread From: Hugh Dickins @ 2026-09-03 17:46 UTC (permalink / raw) To: Sasha Levin Cc: stable, David Hildenbrand (Arm), Hugh Dickins, Ackerley Tng, Jason Gunthorpe, John Hubbard, Kiryl Shutsemau, Peter Xu, Andrew Morton On Thu, 3 Sep 2026, Sasha Levin wrote: > From: "David Hildenbrand (Arm)" <david@kernel.org> > > [ Upstream commit 078e1a0fc41a42baaf113383b52dab8874c0b967 ] > > folio_may_be_lru_cached() is currently only true for small folios, and > for small folios FOLL_PIN adds GUP_PIN_COUNTING_BIAS references instead > of 1 in try_grab_folio()/try_grab_folio_fast(). > > Consequently, our > > folio_ref_count(folio) != folio_expected_ref_count(folio) + 1 > > check in collect_longterm_unpinnable_folios() will currently always > identify "reference mismatch" and first drain the local LRU cache to then > drain the LRU cache on all CPUs, as collect_longterm_unpinnable_folios() > is really called after pinning the folios with FOLL_PIN. > > Add a comment because the current code is not quite intuitive: we used to > drain only to make sure the folio_isolate_lru() would succeed. But then we > also started draining to make later migration more reliable. > > We'll refactor that code soon a bit, to also make it usable in other > context where we really want to remove any references from LRU caches. > > Let's add CC stable, because having an easy way for excessive LRU cache > draining on all CPUs does not sound right. In common scenarios we > don't expect to ever have to drain. > > Link: https://lore.kernel.org/20260731-check_and_migrate_movable_folios-v1-1-e0002d7b791e@kernel.org > Fixes: 98c6d259319e ("mm/gup: check ref_count instead of lru before migration") > Fixes: a09a8a1fbb37 ("mm/gup: local lru_add_drain() to avoid lru_add_drain_all()") > Signed-off-by: David Hildenbrand (Arm) <david@kernel.org> > Acked-by: Hugh Dickins <hughd@google.com> > Cc: Ackerley Tng <ackerleytng@google.com> > Cc: Jason Gunthorpe <jgg@ziepe.ca> > Cc: John Hubbard <jhubbard@nvidia.com> > Cc: Kiryl Shutsemau <kas@kernel.org> > Cc: Peter Xu <peterx@redhat.com> > Cc: <stable@vger.kernel.org> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org> > Signed-off-by: Sasha Levin <sashal@kernel.org> Thanks for your effort on this, and this 3/3 itself looks fine to me: but I was puzzled why it did not apply already, and went to lore to see what your 1/3 and 2/3 look like (ah, supplying folio_has_pincount()), and those (struct folio rearrangement!) I'm very uneasy with backporting to 6.12, especially just to get a folio_is_pincount(). Please hold off on these for now: they will need an explicit Ack from David Hildenbrand, maybe next week, and I expect him to share my unease, and offer you an alternative folio_has_pincount() instead of 1/3 and 2/3. Hugh > --- > mm/gup.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/mm/gup.c b/mm/gup.c > index 937865ecfae00..810a4c32ee870 100644 > --- a/mm/gup.c > +++ b/mm/gup.c > @@ -2362,6 +2362,7 @@ static unsigned long collect_longterm_unpinnable_folios( > > for (folio = pofs_get_folio(pofs, i); folio; > folio = pofs_next_folio(folio, pofs, &i)) { > + const int pin_refs = folio_has_pincount(folio) ? 1 : GUP_PIN_COUNTING_BIAS; > > if (folio_is_longterm_pinnable(folio)) > continue; > @@ -2376,15 +2377,20 @@ static unsigned long collect_longterm_unpinnable_folios( > continue; > } > > + /* > + * We drain not only to make the folio_isolate_lru() succeed, > + * but also to remove any other folio references from LRU > + * caches. > + */ > if (drained == 0 && folio_may_be_lru_cached(folio) && > folio_ref_count(folio) != > - folio_expected_ref_count(folio) + 1) { > + folio_expected_ref_count(folio) + pin_refs) { > lru_add_drain(); > drained = 1; > } > if (drained == 1 && folio_may_be_lru_cached(folio) && > folio_ref_count(folio) != > - folio_expected_ref_count(folio) + 1) { > + folio_expected_ref_count(folio) + pin_refs) { > lru_add_drain_all(); > drained = 2; > } > -- > 2.53.0 > > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-09-03 17:46 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-09-03 11:28 FAILED: patch "[PATCH] mm/gup: fix always draining LRU caches in" failed to apply to 6.12-stable tree gregkh 2026-09-03 15:00 ` [PATCH 6.12.y 1/3] mm: move hugetlb specific things in folio to page[3] Sasha Levin 2026-09-03 15:00 ` [PATCH 6.12.y 2/3] mm: move _pincount in folio to page[2] on 32bit Sasha Levin 2026-09-03 15:00 ` [PATCH 6.12.y 3/3] mm/gup: fix always draining LRU caches in collect_longterm_unpinnable_folios() Sasha Levin 2026-09-03 17:46 ` Hugh Dickins
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox