From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Julia Lawall <julia.lawall@inria.fr>,
Vincent Guittot <vincent.guittot@linaro.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Valentin Schneider <vschneid@redhat.com>,
Tim Chen <tim.c.chen@linux.intel.com>,
David Vernet <void@manifault.com>,
"Gautham R. Shenoy" <gautham.shenoy@amd.com>
Subject: Re: [RFC PATCH 00/14] Introducing TIF_NOTIFY_IPI flag
Date: Fri, 15 Mar 2024 12:01:43 +0530 [thread overview]
Message-ID: <87fe0305-d698-608a-3801-fd31c52fc082@amd.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2403072036080.3161@hadrien>
(Trimming the cc list to only include scheduler folks)
Hello Julia,
On 3/8/2024 1:26 AM, Julia Lawall wrote:
>
>
> On Wed, 6 Mar 2024, Vincent Guittot wrote:
>
>> Hi Prateek,
>>
>> Adding Julia who could be interested in this patchset. Your patchset
>> should trigger idle load balance instead of newly idle load balance
>> now when the polling is used. This was one reason for not migrating
>> task in idle CPU
>
> My situation is roughly as follows:
>
> The machine is an Intel 6130 with two sockets and 32 hardware threads
> (subsequently referred to as cores) per socket. The test is bt.B of the
> OpenMP version of the NAS benchmark suite. Initially there is one
> thread per core. NUMA balancing occurs, resulting in a move, and thus 31
> threads on one socket and 33 on the other.
>
> Load balancing should result in the idle core pulling one of the threads
> from the other socket. But that doesn't happen in normal load balancing,
> because all 33 threads on the overloaded socket are considered to have a
> preference for that socket. Active balancing could pull a thread, but it
> is not triggered because the idle core is seen as being newly idle.
>
> The question is then why a core that has been idle for up to multiple
> seconds is continually seen as newly idle. Every 4ms, a scheduler tick
> submits some work to try to load balance. This submission process
> previously broke out of the idle loop due to a need_resched, hence the
> same issue as involved in this patch series. The need_resched caused
> invocation of schedule, which would then see that there was no task to
> pick, making the core be considered to be newly idle. The classification
> as newly idle doesn't take into account whether any task was running prior
> to the call to schedule.
>
> The load balancing work that was submitted every 4ms is also a NOP due a
> test for need_resched.
>
> This patch series no longer makes need resched be the only way out of the
> idle loop. Without the need resched, the load balancing work that is
> submitted every 4ms can actually try to do load balancing. The core is
> not newly idle, so active balancing could in principle occur. But now
> nothing happens because the work is run by ksoftirqd. The presence of
> ksoftirqd on the idle core means that the core is no longer idle. Thus
> there is no more need for load balancing.
Thinking slightly ahead, assuming that the idle balancer realizes
the ksoftirqd is running for load balancing itself and discounts it
from consideration, won't the NUMA_IMBALANCE_MIN considered by
adjust_numa_imbalance() continue to keep the 33-31 distribution?
In both task_numa_find_cpu() [1] and calculate_imbalance() [2],
even though the scheduler classifies the local group as
"group_has_spare", with the imbalance <= NUMA_IMBALANCE_MIN which is 2,
a migration across the NUMA domains is still restricted I believe.
Can you try setting NUMA_IMBALANCE_MIN to 0 and checking if the
situation changes with the upstream kernel? I'm hoping the newidle
balance that is triggered without this series on the way to idle, is
good enough to pull the task towards itself.
Please ignore if you've already tried this. I might have missed it
when going through the original thread.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/sched/fair.c?h=v6.8&id=e8f897f4afef0031fe618a8e94127a0934896aba#n2368
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/sched/fair.c?h=v6.8&id=e8f897f4afef0031fe618a8e94127a0934896aba#n10743
>
> [snip..]
>
--
Thanks and Regards,
Prateek
prev parent reply other threads:[~2024-03-15 6:32 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 17:14 K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 01/14] thread_info: Add helpers to test and clear TIF_NOTIFY_IPI K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 02/14] sched: Define a need_resched_or_ipi() helper and use it treewide K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 03/14] sched/core: Use TIF_NOTIFY_IPI to notify an idle CPU in TIF_POLLING mode of pending IPI K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 04/14] x86/thread_info: Introduce TIF_NOTIFY_IPI flag K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 05/14] arm/thread_info: " K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 06/14] alpha/thread_info: " K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 07/14] openrisc/thread_info: " K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 08/14] powerpc/thread_info: " K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 09/14] sh/thread_info: " K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 10/14] sparc/thread_info: " K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 11/14] csky/thread_info: " K Prateek Nayak
2024-02-23 4:37 ` Guo Ren
2024-02-20 17:14 ` [RFC PATCH 12/14] parisc/thread_info: " K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 13/14] nios2/thread_info: " K Prateek Nayak
2024-02-20 17:14 ` [RFC PATCH 14/14] microblaze/thread_info: " K Prateek Nayak
2024-03-06 9:44 ` [RFC PATCH 00/14] Introducing " Linus Walleij
2024-03-06 10:04 ` K Prateek Nayak
2024-03-06 9:59 ` Vincent Guittot
2024-03-06 10:18 ` K Prateek Nayak
2024-03-06 10:28 ` Vincent Guittot
2024-03-07 19:56 ` Julia Lawall
2024-03-15 6:31 ` K Prateek Nayak [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=87fe0305-d698-608a-3801-fd31c52fc082@amd.com \
--to=kprateek.nayak@amd.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=gautham.shenoy@amd.com \
--cc=julia.lawall@inria.fr \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tim.c.chen@linux.intel.com \
--cc=vincent.guittot@linaro.org \
--cc=void@manifault.com \
--cc=vschneid@redhat.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 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®