Rafael Aquini fa3e26fdc1 mm: folio_may_be_lru_cached() unless folio_test_large()
JIRA: https://redhat.atlassian.net/browse/RHEL-145695

commit 2da6de30e60dd9bb14600eff1cc99df2fa2ddae3
Author: Hugh Dickins <hughd@google.com>
Date:   Mon Sep 8 15:23:15 2025 -0700

    mm: folio_may_be_lru_cached() unless folio_test_large()

    mm/swap.c and mm/mlock.c agree to drain any per-CPU batch as soon as a
    large folio is added: so collect_longterm_unpinnable_folios() just wastes
    effort when calling lru_add_drain[_all]() on a large folio.

    But although there is good reason not to batch up PMD-sized folios, we
    might well benefit from batching a small number of low-order mTHPs (though
    unclear how that "small number" limitation will be implemented).

    So ask if folio_may_be_lru_cached() rather than !folio_test_large(), to
    insulate those particular checks from future change.  Name preferred to
    "folio_is_batchable" because large folios can well be put on a batch: it's
    just the per-CPU LRU caches, drained much later, which need care.

    Marked for stable, to counter the increase in lru_add_drain_all()s from
    "mm/gup: check ref_count instead of lru before migration".

    Link: https://lkml.kernel.org/r/57d2eaf8-3607-f318-e0c5-be02dce61ad0@google.com
    Fixes: 9a4e9f3b2d ("mm: update get_user_pages_longterm to migrate pages allocated from CMA region")
    Signed-off-by: Hugh Dickins <hughd@google.com>
    Suggested-by: David Hildenbrand <david@redhat.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Cc: "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>
    Cc: Axel Rasmussen <axelrasmussen@google.com>
    Cc: Chris Li <chrisl@kernel.org>
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: Jason Gunthorpe <jgg@ziepe.ca>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: John Hubbard <jhubbard@nvidia.com>
    Cc: Keir Fraser <keirf@google.com>
    Cc: Konstantin Khlebnikov <koct9i@gmail.com>
    Cc: Li Zhe <lizhe.67@bytedance.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Peter Xu <peterx@redhat.com>
    Cc: Rik van Riel <riel@surriel.com>
    Cc: Shivank Garg <shivankg@amd.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Cc: Wei Xu <weixugc@google.com>
    Cc: Will Deacon <will@kernel.org>
    Cc: yangge <yangge1116@126.com>
    Cc: Yuanchu Xie <yuanchu@google.com>
    Cc: Yu Zhao <yuzhao@google.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Signed-off-by: Rafael Aquini <raquini@redhat.com>
2026-07-31 14:51:05 -04:00
2026-07-31 14:50:55 -04:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
S
Description
No description provided
Readme
2.8 GiB
Languages
C 97.5%
Assembly 1%
Shell 0.6%
Python 0.3%
Makefile 0.3%