public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: "Huang, Ying" <ying.huang@linux.alibaba.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Donet Tom <donettom@linux.ibm.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	 Ingo Molnar <mingo@redhat.com>,
	 Peter Zijlstra <peterz@infradead.org>,
	 Ritesh Harjani <ritesh.list@gmail.com>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	 Baolin Wang <baolin.wang@linux.alibaba.com>,
	 Ying Huang <huang.ying.caritas@gmail.com>,
	 Juri Lelli <juri.lelli@redhat.com>,
	 Mel Gorman <mgorman@suse.de>,
	 Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	 Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH] sched/numa, mm: Skip page promotion if cpu pid is valid
Date: Wed, 01 Apr 2026 17:48:23 +0800	[thread overview]
Message-ID: <874ilvui3c.fsf@DESKTOP-5N7EMDA> (raw)
In-Reply-To: <7dd35e65-e0c2-423d-a82d-c9e488e85e33@kernel.org> (David Hildenbrand's message of "Tue, 31 Mar 2026 12:04:10 +0200")

"David Hildenbrand (Arm)" <david@kernel.org> writes:

> On 3/31/26 10:33, Huang, Ying wrote:
>> Hi, Donet,
>> 
>> Donet Tom <donettom@linux.ibm.com> writes:
>> 
>>> On 3/26/26 3:59 PM, David Hildenbrand (Arm) wrote:
>>>> Is that measurable? Should we at least have a Fixes: ?
>>>>
>>>> /*
>>>>   * When ...
>>>>
>>>> IIUC, as timestamp we use jiffies_to_msecs(). So, soon after bootup,
>>>> we would no longer get false positives for cpupid_valid().
>>>> I suppose overflows are not a problem, correct?
>>>
>>> Thank you, David, for guiding me in the right direction.
>>>
>>> I initially thought that overflows would not occur, and therefore
>>> cpupid_valid() would not produce false positives. However,
>>> after looking into it further, it appears that overflow can
>>> happen when storing the access time.
>>>
>>> The last_cpupid field is used to store the last access time.
>>> From the code, it appears that 21 bits are used for this
>>> (#define LAST_CPUPID_SHIFT (LAST__PID_SHIFT + LAST__CPU_SHIFT)).
>>>
>>> With 21 bits, the maximum value that can be stored is
>> 
>> It can be less than 21 bits, if CONFIG_NR_CPUS is small.
>> 
>> 	DEFINE(NR_CPUS_BITS, order_base_2(CONFIG_NR_CPUS));
>> 
>>> 2097151ms (35Hrs) . If the access time exceeds this
>>> range, it can overflow, which may lead to cpupid_valid()
>>> returning false positives.
>>>
>>> I think we need a reliable way to determine cpupid_valid() that
>>> does not produce false positives.
>> 
>> Yes.  IMHO, false positives is unavoidable.  So, the patch fixes a
>> temporal performance issue at the cost of a longstanding performance
>> issue.  Right?
>
>
> Could we set aside a bit to indicate "cpuid vs. time" ? We'd lose one
> bit for time, to we care?

Do we need one more bit for time and cpupid?  However, page flags are
precious resources.

> Would make it all easier to get ...

---
Best Regards,
Huang, Ying


      parent reply	other threads:[~2026-04-01  9:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26  7:12 [PATCH] sched/numa, mm: Skip page promotion if cpu pid is valid Donet Tom
2026-03-26 10:29 ` David Hildenbrand (Arm)
2026-03-27 18:54   ` Donet Tom
2026-03-31  8:33     ` Huang, Ying
2026-03-31  9:03       ` Donet Tom
2026-03-31  9:17         ` Huang, Ying
2026-03-31 10:00           ` Donet Tom
2026-03-31 10:04       ` David Hildenbrand (Arm)
2026-03-31 15:02         ` Donet Tom
2026-04-01  9:48         ` Huang, Ying [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=874ilvui3c.fsf@DESKTOP-5N7EMDA \
    --to=ying.huang@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@kernel.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=donettom@linux.ibm.com \
    --cc=huang.ying.caritas@gmail.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=ritesh.list@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox