Re: [PATCH v2] mm/page_reporting: Add page_reporting_delay_ms sysctl

From: Andrew Morton

Date: Wed Jul 22 2026 - 18:54:12 EST


On Wed, 22 Jul 2026 21:15:17 +0000 pratmal@xxxxxxxxxx wrote:

> From: Pratyush Mallick <pratmal@xxxxxxxxxx>
>
> Currently, the free page reporting daemon 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 refactors the delay into a dynamically tunable sysctl,
> /proc/sys/vm/page_reporting_delay_ms, measured in milliseconds. The value
> defaults to 2000ms to precisely match the original (2 HZ) behavior.
>

Seems reasonable.

> +The default value is 2000 (2 seconds). The minimum allowed value is
> +0 (immediate reporting) and the maximum allowed value is 10000 (10 seconds).

Why implement a max? If setting it to something enormous causes bad
behavior then Don't Do That?