Re: [PATCH v11 7/7] mm: page_reporting: add flush parameter with page budget
From: Pratyush Mallick
Date: Tue Nov 24 2026 - 15:17:46 EST
On Thu, Nov 19, 2026 at 07:03:00AM -0500, Michael S. Tsirkin wrote:
> Add a write-only module parameter "flush" that triggers immediate
> page reporting. The value specifies approximately how many pages
> (at page_reporting_order) to report. And I mean, very approximately.
[...]
> + if (prdev) {
> + while (budget) {
> + budget -= min(budget, PAGE_REPORTING_CAPACITY);
> + flush_delayed_work(&prdev->work);
> + __page_reporting_request(prdev);
> + flush_delayed_work(&prdev->work);
> + if (atomic_read(&prdev->state) == PAGE_REPORTING_IDLE)
> + break;
> + if (signal_pending(current))
> + break;
> + }
> + }
I think the amount subtracted from budget here doesn't reflect how many
pages actually get reported in that iteration.
Each iteration runs at least one full page_reporting_process() pass,
which walks every zone, migrate type and every order from
page_reporting_order through MAX_PAGE_ORDER. How much a pass reports
depends on how much unreported free memory there is.
So even "echo 1 > flush" can report far more pages than requested.
Could we use this flush as a trigger to start free page reporting right
away rather than waiting for the delay, and flush whatever unreported
free memory is there?