[PATCH] fixup
From: David Hildenbrand (Arm)
Date: Sat Nov 14 2026 - 10:27:17 EST
Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
---
mm/folio.c | 26 ++++++++++++++++++++++++++
mm/util.c | 26 --------------------------
2 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/mm/folio.c b/mm/folio.c
index dc2c796a4ea74..1cafa45a6a834 100644
--- a/mm/folio.c
+++ b/mm/folio.c
@@ -151,6 +151,32 @@ void __folio_put(struct folio *folio)
}
EXPORT_SYMBOL(__folio_put);
+bool folio_ref_count_over_limit_slowpath(const struct folio *folio,
+ unsigned int ref_count)
+{
+ if (ref_count >= FOLIO_REF_COUNT_ADMIN_LIMIT)
+ goto over_limit;
+ /* Background threads must not consume admin reserves. */
+ if (current->flags & PF_KTHREAD)
+ goto over_limit;
+ /* Neither must interrupt contexts on behalf of the interrupted task. */
+ if (!in_task())
+ goto over_limit;
+ /* Capability checks are not safe with IRQs disabled. */
+ if (irqs_disabled())
+ goto over_limit;
+ /* Use the task's credentials, which filesystem overrides cannot change. */
+ if (has_capability_noaudit(current, CAP_SYS_RESOURCE))
+ return false;
+
+over_limit:
+ pr_warn_ratelimited("folio:%p refcount:%d mapcount:%d mapping:%p index:%#lx reached refcount limit\n",
+ folio, (int)ref_count, folio_mapcount(folio),
+ folio_mapping(folio), folio->index);
+ return true;
+}
+EXPORT_SYMBOL_GPL(folio_ref_count_over_limit_slowpath);
+
typedef void (*move_fn_t)(struct lruvec *lruvec, struct folio *folio);
/*
diff --git a/mm/util.c b/mm/util.c
index c9c3dc4b490fa..80f6c714844f2 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -791,32 +791,6 @@ int folio_mc_copy(struct folio *dst, struct folio *src)
}
EXPORT_SYMBOL(folio_mc_copy);
-bool folio_ref_count_over_limit_slowpath(const struct folio *folio,
- unsigned int ref_count)
-{
- if (ref_count >= FOLIO_REF_COUNT_ADMIN_LIMIT)
- goto over_limit;
- /* Background threads must not consume admin reserves. */
- if (current->flags & PF_KTHREAD)
- goto over_limit;
- /* Neither must interrupt contexts on behalf of the interrupted task. */
- if (!in_task())
- goto over_limit;
- /* Capability checks are not safe with IRQs disabled. */
- if (irqs_disabled())
- goto over_limit;
- /* Use the task's credentials, which filesystem overrides cannot change. */
- if (has_capability_noaudit(current, CAP_SYS_RESOURCE))
- return false;
-
-over_limit:
- pr_warn_ratelimited("folio:%p refcount:%d mapcount:%d mapping:%p reached refcount limit\n",
- folio, (int)ref_count, folio_mapcount(folio),
- folio_mapping(folio));
- return true;
-}
-EXPORT_SYMBOL_GPL(folio_ref_count_over_limit_slowpath);
-
int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_GUESS;
static int sysctl_overcommit_ratio __read_mostly = 50;
static unsigned long sysctl_overcommit_kbytes __read_mostly;
--
2.56.0
--
Cheers,
David