All of lore.kernel.org
 help / color / mirror / Atom feed
From: pratmal@google.com
To: Anshuman Khandual <anshuman.khandual@arm.com>,
	David Hildenbrand <david@redhat.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@kernel.org>
Cc: Greg Thelen <gthelen@google.com>,
	Suren Baghdasaryan <surenb@google.com>,
	 Michal Hocko <mhocko@suse.com>,
	Brendan Jackman <jackmanb@google.com>,
	 Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] mm/page_reporting: Add page_reporting_delay sysctl
Date: Mon, 20 Jul 2026 19:24:15 +0000	[thread overview]
Message-ID: <20260720192415.4060431-1-pratmal@google.com> (raw)
In-Reply-To: <03f6d16c-0f1c-4123-abb4-81a73eecaff1@arm.com>

On 7/16/26 02:41, Anshuman Khandual wrote:
> On 15/07/26 6:29 PM, David Hildenbrand (Arm) wrote:
>> -#define PAGE_REPORTING_DELAY	(2 * HZ)
>> -static struct page_reporting_dev_info __rcu *pr_dev_info __read_mostly;
>> -
>> Why are you moving that?
> 
> +1

I wanted the new definitions grouped together, and the sysctl handler has
to sit below the enum so it can see PAGE_REPORTING_REQUESTED. But that
only constrains where the handler goes, not the declaration. I'll leave
pr_dev_info where it was.

>> +static unsigned int page_reporting_delay = 2000;
>>
>> Maybe "2 * MSEC_PER_SEC;"
>>
>> Would we want to call that page_reporting_delay_ms to make it clearer what we
>> are dealing with?
> 
> +1

Agreed on both. I'll rename the sysctl to page_reporting_delay_ms as well
in v2.

>> +static int page_reporting_delay_sysctl(const struct ctl_table *table, int write,
>> +				       void *buffer, size_t *lenp, loff_t *ppos)
>>
>> We prefer two tabs here in MM land.

Thanks. Will fix this.

>> +	ret = proc_dointvec(table, write, buffer, lenp, ppos);
>> +	if (ret < 0 || !write)
>> +		return ret;
>>
>> Would we want to cap it at reasonable values?
> 
> Possibly with a macro PAGE_REPORTING_DELAY_MS_MAX or similar.

Yes. Will fix this in v2.

Will use  proc_douintvec_minmax() with a floor and a ceiling (using a 
new PAGE_REPORTING_DELAY_MS_MAX macro).

>> +	rcu_read_lock();
>> +	prdev = rcu_dereference(pr_dev_info);
>> +	if (prdev && atomic_read(&prdev->state) == PAGE_REPORTING_REQUESTED)
>> +		mod_delayed_work(...);
>> +	rcu_read_unlock();
>>
>> Is that really required? Seems unnecessary given that we expect something in the
>> range of a couple of seconds max.
> 
> Agreed.

Our use case is that the delay isn't static. A daemon in the guest watches
for host memory pressure and drops the delay to expedite reporting, then
raises it again once the pressure clears. The delay can be tens of seconds
when we're absorbing churn, so waiting out the current window defeats the
purpose of the dynamic adjustment. Apologies, I should have clarified this 
in the original commit message.

I'm happy to drop it or decouple this triggering behavior from the tuning
behavior. We could probably create a separate sysctl to manually trigger 
the reporting instead.

Thanks to both of you for the review.

Pratyush Mallick. 


      reply	other threads:[~2026-07-20 19:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 17:14 [RFC PATCH] mm/page_reporting: Add page_reporting_delay sysctl pratmal
2026-07-15 12:59 ` David Hildenbrand (Arm)
2026-07-16  3:30   ` Anshuman Khandual
2026-07-20 19:24     ` pratmal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260720192415.4060431-1-pratmal@google.com \
    --to=pratmal@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=david@redhat.com \
    --cc=gthelen@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.