Re: [PATCH v4] mm/page_reporting: Add page_reporting_delay_ms module parameter

"David Hildenbrand (Arm)" <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.kernel.mm,gmane.linux.documentation
Message-ID <[email protected]>
On 7/31/26 23:34, Andrew Morton wrote:
> On Fri, 31 Jul 2026 19:37:05 +0000 [email protected] wrote:
> 
>> Free page reporting currently hardcodes a 2-second interval between
>> reports. This rigid delay cannot accommodate diverse guest workloads.
>>
>> This patch introduces a module parameter, page_reporting_delay_ms
>> (default: 2000), allowing users to tune the reporting rate:
>>  - Lower values enable aggressive memory reclamation by returning unused
>>    pages to the host immediately.
>>  - Higher values help batch pages during spiky allocation/free churn,
>>    reducing hypercalls and nested page fault overheads.
>>
>> Setting the delay to 0 is safe and execution is strictly gated by:
>>  - reporting is only triggered by high-order page frees.
>>  - expensive hypercalls are bounded by a slot capacity watermark check
>>    before proceeding.
> 
> This conflcits with the just-upstreamed 0b45f6927a1
> ("mm/page_reporting: use system_freezable_wq to fix UAF during
> suspend")
> (https://lore.kernel.org/[email protected]).
> 
> Please review my resolution:
> 
> --- 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 {
> @@ -57,6 +61,13 @@ enum {
>  	PAGE_REPORTING_ACTIVE
>  };
>  
> +/* schedule work for page reporting */
> +static void page_reporting_schedule_work(struct page_reporting_dev_info *prdev)
> +{
> +	queue_delayed_work(system_freezable_wq, &prdev->work,
> +			      msecs_to_jiffies(page_reporting_delay_ms));

^ just double checking whether that is indented properly .


Acked-by: David Hildenbrand (Arm) <[email protected]>

-- 
Cheers,

David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.