From: Raghavendra K T <raghavendra.kt@amd.com>
To: Peter Zijlstra <peterz@infradead.org>, Mel Gorman <mgorman@suse.de>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Ingo Molnar <mingo@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@redhat.com>,
rppt@kernel.org, Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Bharata B Rao <bharata@amd.com>,
Aithal Srikanth <sraithal@amd.com>,
kernel test robot <oliver.sang@intel.com>,
Sapkal Swapnil <Swapnil.Sapkal@amd.com>,
K Prateek Nayak <kprateek.nayak@amd.com>
Subject: Re: [PATCH V1 1/1] sched/numa: Fix mm numa_scan_seq based unconditional scan
Date: Thu, 2 Nov 2023 10:47:26 +0530 [thread overview]
Message-ID: <bb5cf1ee-62ef-5019-4974-88a66555557f@amd.com> (raw)
In-Reply-To: <20231101103114.GK15024@noisy.programming.kicks-ass.net>
On 11/1/2023 4:01 PM, Peter Zijlstra wrote:
> On Wed, Nov 01, 2023 at 09:21:01AM +0000, Mel Gorman wrote:
>> On Fri, Oct 20, 2023 at 09:27:46PM +0530, Raghavendra K T wrote:
>>> Since commit fc137c0ddab2 ("sched/numa: enhance vma scanning logic")
>>>
>>> NUMA Balancing allows updating PTEs to trap NUMA hinting faults if the
>>> task had previously accessed VMA. However unconditional scan of VMAs are
>>> allowed during initial phase of VMA creation until process's
>>> mm numa_scan_seq reaches 2 even though current task had not accessed VMA.
>>>
>>> Rationale:
>>> - Without initial scan subsequent PTE update may never happen.
>>> - Give fair opportunity to all the VMAs to be scanned and subsequently
>>> understand the access pattern of all the VMAs.
>>>
>>> But it has a corner case where, if a VMA is created after some time,
>>> process's mm numa_scan_seq could be already greater than 2.
>>>
>>> For e.g., values of mm numa_scan_seq when VMAs are created by running
>>> mmtest autonuma benchmark briefly looks like:
>>> start_seq=0 : 459
>>> start_seq=2 : 138
>>> start_seq=3 : 144
>>> start_seq=4 : 8
>>> start_seq=8 : 1
>>> start_seq=9 : 1
>>> This results in no unconditional PTE updates for those VMAs created after
>>> some time.
>>>
>>> Fix:
>>> - Note down the initial value of mm numa_scan_seq in per VMA start_seq.
>>> - Allow unconditional scan till start_seq + 2.
>>>
>>> Result:
>>> SUT: AMD EPYC Milan with 2 NUMA nodes 256 cpus.
>>> base kernel: upstream 6.6-rc6 with Mels patches [1] applied.
>>>
>>> kernbench
>>> ========== base patched %gain
>>> Amean elsp-128 165.09 ( 0.00%) 164.78 * 0.19%*
>>>
>>> Duration User 41404.28 41375.08
>>> Duration System 9862.22 9768.48
>>> Duration Elapsed 519.87 518.72
>>>
>>> Ops NUMA PTE updates 1041416.00 831536.00
>>> Ops NUMA hint faults 263296.00 220966.00
>>> Ops NUMA pages migrated 258021.00 212769.00
>>> Ops AutoNUMA cost 1328.67 1114.69
>>>
>>> autonumabench
>>>
>>> NUMA01_THREADLOCAL
>>> ==================
>>> Amean elsp-NUMA01_THREADLOCAL 81.79 (0.00%) 67.74 * 17.18%*
>>>
>>> Duration User 54832.73 47379.67
>>> Duration System 75.00 185.75
>>> Duration Elapsed 576.72 476.09
>>>
>>> Ops NUMA PTE updates 394429.00 11121044.00
>>> Ops NUMA hint faults 1001.00 8906404.00
>>> Ops NUMA pages migrated 288.00 2998694.00
>>> Ops AutoNUMA cost 7.77 44666.84
>>>
>>> Link: https://lore.kernel.org/linux-mm/ZSXF3AFZgIld1meX@gmail.com/T/
>>>
>>> Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com>
>>
>> Acked-by: Mel Gorman <mgorman@suse.de>
>
> Thanks, will queue for the next merge window (6.8 I think that is) once
> 6.7-rc1 comes around.
Thank you Mel, PeterZ.
Meanwhile, I will check if extending #history (PeterZ) on this changed
baseline, as well as implications of extending #bits for PIDS (Ingo)
suggested (especially larger machine) helps and come back if I find
anything interesting.
Thanks and Regards
- Raghu
next prev parent reply other threads:[~2023-11-02 5:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 15:57 [PATCH V1 0/1] " Raghavendra K T
2023-10-20 15:57 ` [PATCH V1 1/1] " Raghavendra K T
2023-11-01 9:21 ` Mel Gorman
2023-11-01 10:31 ` Peter Zijlstra
2023-11-02 5:17 ` Raghavendra K T [this message]
2023-10-23 5:25 ` [PATCH V1 0/1] " Raghavendra K T
2023-10-27 5:24 ` Raghavendra K T
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=bb5cf1ee-62ef-5019-4974-88a66555557f@amd.com \
--to=raghavendra.kt@amd.com \
--cc=Swapnil.Sapkal@amd.com \
--cc=akpm@linux-foundation.org \
--cc=bharata@amd.com \
--cc=david@redhat.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=oliver.sang@intel.com \
--cc=peterz@infradead.org \
--cc=rppt@kernel.org \
--cc=sraithal@amd.com \
--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
all inboxes | Powered by JetHome®