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

From: Pratyush Mallick

Date: Sat Jul 25 2026 - 13:53:38 EST


> > +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?

I don't have a strong justification for where the max should sit.
I'll drop in v3. The value is unsigned int, so it's bounded at UINT_MAX ms
which is around ~49.7 days. So none of the free pages on the guest
would be reported back to the host during that period.

Thanks,
Pratyush


On Wed, Jul 22, 2026 at 3:54 PM Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> 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?
>