+ mm-page_reporting-add-page_reporting_delay_ms-module-parameter.patch added to mm-new branch
Andrew Morton <[email protected]> Mon, 27 Jul 2026 18:14:44 -0700
| Newsgroups | org.kernel.vger.mm-commits |
|---|---|
| Message-ID | <[email protected]> |
The patch titled
Subject: mm/page_reporting: Add page_reporting_delay_ms module parameter
has been added to the -mm mm-new branch. Its filename is
mm-page_reporting-add-page_reporting_delay_ms-module-parameter.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-page_reporting-add-page_reporting_delay_ms-module-parameter.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
The mm-new branch of mm.git is not included in linux-next
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Pratyush Mallick <[email protected]>
Subject: mm/page_reporting: Add page_reporting_delay_ms module parameter
Date: Mon, 27 Jul 2026 23:05:45 +0000
Currently, the free page reporting uses a hardcoded delay of (2 HZ)
between reporting intervals. While this is a reasonable default, it lacks
the flexibility to adapt to varying guest workloads.
A low delay allows aggressive memory reclamation, returning unused pages
to the host as quickly as possible. However, during spiky allocation/free
churn, this immediate reporting can lead to a severe performance penalty
(nested page faults) as the guest re-allocates memory that the host has
just unmapped. In these scenarios, there is benefit from increasing the
delay to batch free pages over a longer window, absorbing the churn
without hypercall and re-fault overhead.
This patch exposes the delay as a module parameter:
/sys/module/page_reporting/parameters/page_reporting_delay_ms, measured in
milliseconds and defaults to 2000ms.
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Pratyush Mallick <[email protected]>
Reviewed-by: SJ Park <[email protected]>
Cc: Link Lin <[email protected]>
Cc: Anshuman Khandual <[email protected]>
Cc: Brendan Jackman <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Greg Thelen <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Liam R. Howlett <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: SeongJae Park <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Zi Yan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---
Documentation/admin-guide/kernel-parameters.txt | 6 ++++
mm/page_reporting.c | 19 ++++++++------
2 files changed, 17 insertions(+), 8 deletions(-)
--- a/Documentation/admin-guide/kernel-parameters.txt~mm-page_reporting-add-page_reporting_delay_ms-module-parameter
+++ a/Documentation/admin-guide/kernel-parameters.txt
@@ -4813,6 +4813,12 @@ Kernel parameters
Adjust the minimal page reporting order. The page
reporting is disabled when it exceeds MAX_PAGE_ORDER.
+ page_reporting.page_reporting_delay_ms=
+ [KNL] Free page reporting delay in milliseconds
+ Format: <unsigned integer>
+ Adjust the delay in milliseconds between free page
+ reporting intervals. Default is 2000 (2 seconds).
+
panic= [KNL] Kernel behaviour on panic: delay <timeout>
timeout > 0: seconds before rebooting
timeout = 0: wait forever
--- a/mm/page_reporting.c~mm-page_reporting-add-page_reporting_delay_ms-module-parameter
+++ a/mm/page_reporting.c
@@ -48,7 +48,11 @@ MODULE_PARM_DESC(page_reporting_order, "
*/
EXPORT_SYMBOL_GPL(page_reporting_order);
-#define PAGE_REPORTING_DELAY (2 * HZ)
+static unsigned int page_reporting_delay_ms = 2 * MSEC_PER_SEC;
+module_param(page_reporting_delay_ms, uint, 0644);
+MODULE_PARM_DESC(page_reporting_delay_ms,
+ "Set page reporting delay in milliseconds");
+
static struct page_reporting_dev_info __rcu *pr_dev_info __read_mostly;
enum {
@@ -77,12 +81,11 @@ __page_reporting_request(struct page_rep
return;
/*
- * Delay the start of work to allow a sizable queue to build. For
- * now we are limiting this to running no more than once every
- * couple of seconds.
+ * Delay the start of work to allow a sizable queue to build.
+ * We limit this based on page_reporting_delay_ms.
*/
queue_delayed_work(system_freezable_wq, &prdev->work,
- PAGE_REPORTING_DELAY);
+ msecs_to_jiffies(page_reporting_delay_ms));
}
/* notify prdev of free page reporting request */
@@ -337,13 +340,13 @@ static void page_reporting_process(struc
err_out:
/*
* If the state has reverted back to requested then there may be
- * additional pages to be processed. We will defer for 2s to allow
- * more pages to accumulate.
+ * additional pages to be processed. We will defer by
+ * page_reporting_delay_ms to allow more pages to accumulate.
*/
state = atomic_cmpxchg(&prdev->state, state, PAGE_REPORTING_IDLE);
if (state == PAGE_REPORTING_REQUESTED)
queue_delayed_work(system_freezable_wq, &prdev->work,
- PAGE_REPORTING_DELAY);
+ msecs_to_jiffies(page_reporting_delay_ms));
}
static DEFINE_MUTEX(page_reporting_mutex);
_
Patches currently in -mm which might be from [email protected] are
mm-page_reporting-add-page_reporting_delay_ms-module-parameter.patch