mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Cc: Valentin Schneider <vschneid@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Ricardo Neri <ricardo.neri@intel.com>,
	"Ravi V. Shankar" <ravi.v.shankar@intel.com>,
	Ben Segall <bsegall@google.com>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Len Brown <len.brown@intel.com>, Mel Gorman <mgorman@suse.de>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	Ionela Voinescu <ionela.voinescu@arm.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	"Tim C . Chen" <tim.c.chen@intel.com>
Subject: Re: [PATCH v3 06/10] sched/fair: Use the prefer_sibling flag of the current sched domain
Date: Thu, 23 Feb 2023 11:09:55 +0100	[thread overview]
Message-ID: <183aec1b-5626-e972-bbed-aca038280828@arm.com> (raw)
In-Reply-To: <20230216052105.GA20785@ranerica-svr.sc.intel.com>

On 16/02/2023 06:21, Ricardo Neri wrote:
> On Mon, Feb 13, 2023 at 10:43:28PM -0800, Ricardo Neri wrote:
>> On Mon, Feb 13, 2023 at 01:17:09PM +0100, Dietmar Eggemann wrote:
>>> On 10/02/2023 19:31, Ricardo Neri wrote:
>>>> On Fri, Feb 10, 2023 at 05:12:30PM +0000, Valentin Schneider wrote:
>>>>> On 10/02/23 17:53, Peter Zijlstra wrote:
>>>>>> On Fri, Feb 10, 2023 at 02:54:56PM +0000, Valentin Schneider wrote:

[...]

>>> Can you not detect the E-core dst_cpu case on MC with:
>>>
>>> +       if (child)
>>> +               sds->prefer_sibling = child->flags & SD_PREFER_SIBLING;
>>> +       else if (sds->busiest)
>>> +               sds->prefer_sibling = sds->busiest->group_weight > 1;
>>
>> Whose child wants the prefer_sibling setting? In update_sd_lb_stats(), it
>> is set based on the flags of the destination CPU's sched domain. But when
>> used in find_busiest_group() tasks are spread from the busiest group's
>> child domain.
>>
>> Your proposed code, also needs a check for SD_PREFER_SIBLING, no?
> 
> I tweaked the solution that Dietmar proposed:
> 
> -	sds->prefer_sibling = child && child->flags & SD_PREFER_SIBLING;
> +	if (sds->busiest)
> +		sds->prefer_sibling = sds->busiest->flags & SD_PREFER_SIBLING;

Maybe:

sds->prefer_sibling = !!(sds->busiest->flags & SD_PREFER_SIBLING);

1 vs 2048 ?

> This comes from the observation that the prefer_sibling setting acts on
> busiest group. It then depends on whether the busiest group, not the local
> group, has child sched sched domains. Today it works because in most cases
> both the local and the busiest groups have child domains with the SD_
> PREFER_SIBLING flag.
> 
> This would also satisfy sched domains with the SD_ASYM_CPUCAPACITY flag as
> prefer_sibling would not be set in that case.
> 
> It would also conserve the current behavior at the NUMA level. We would
> not need to implement SD_SPREAD_TASKS.
> 
> This would both fix the SMT vs non-SMT bug and be less invasive.

Yeah, much better! I always forget that we have those flags on SGs now
as well. Luckily, we just need to check busiest sg to cover all cases.


  parent reply	other threads:[~2023-02-23 10:10 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07  4:58 [PATCH v3 00/10] sched/fair: Avoid unnecessary migrations within SMT domains Ricardo Neri
2023-02-07  4:58 ` [PATCH v3 01/10] sched/fair: Generalize asym_packing logic for SMT cores Ricardo Neri
2023-02-07  4:58 ` [PATCH v3 02/10] sched/fair: Move is_core_idle() out of CONFIG_NUMA Ricardo Neri
2023-02-07  4:58 ` [PATCH v3 03/10] sched/fair: Only do asym_packing load balancing from fully idle SMT cores Ricardo Neri
2023-02-07  4:58 ` [PATCH v3 04/10] sched/fair: Let low-priority cores help high-priority busy " Ricardo Neri
2023-02-08  7:56   ` Vincent Guittot
2023-02-09 11:53     ` Peter Zijlstra
2023-02-10  0:43       ` Ricardo Neri
2023-02-10  8:41         ` Peter Zijlstra
2023-02-10 13:05           ` Ricardo Neri
2023-02-10  1:52     ` Ricardo Neri
2023-02-13 13:40   ` Dietmar Eggemann
2023-02-13 23:23     ` Ricardo Neri
2023-03-10  0:51   ` Tim Chen
2023-03-14 23:54     ` Ricardo Neri
2023-02-07  4:58 ` [PATCH v3 05/10] sched/fair: Keep a fully_busy SMT sched group as busiest Ricardo Neri
2023-02-07  4:58 ` [PATCH v3 06/10] sched/fair: Use the prefer_sibling flag of the current sched domain Ricardo Neri
2023-02-08  7:48   ` Vincent Guittot
2023-02-10 13:24     ` Ricardo Neri
2023-02-09 13:17   ` Chen Yu
2023-02-09 20:00     ` Chen, Tim C
2023-02-09 23:05       ` Tim Chen
2023-02-10  3:16         ` Ricardo Neri
2023-02-10  6:55         ` Chen Yu
2023-02-10 10:08   ` Peter Zijlstra
2023-02-10 14:54     ` Valentin Schneider
2023-02-10 16:53       ` Peter Zijlstra
2023-02-10 17:12         ` Valentin Schneider
2023-02-10 18:31           ` Ricardo Neri
2023-02-13 12:17             ` Dietmar Eggemann
2023-02-14  6:43               ` Ricardo Neri
2023-02-16  5:21                 ` Ricardo Neri
2023-02-16 12:16                   ` Peter Zijlstra
2023-02-17  1:41                     ` Ricardo Neri
2023-02-23 10:09                   ` Dietmar Eggemann [this message]
2023-02-24 12:29                     ` Ricardo Neri
     [not found]         ` <tencent_60A804570F09C0CFE0495D5B984941123A05@qq.com>
2023-02-20  9:45           ` Valentin Schneider
     [not found]             ` <tencent_6C38D389245FD03C6E1312999FEDD394F606@qq.com>
2023-02-21 18:15               ` Valentin Schneider
2023-02-07  4:58 ` [PATCH v3 07/10] sched/fair: Do not even the number of busy CPUs via asym_packing Ricardo Neri
2023-02-13 12:44   ` Dietmar Eggemann
2023-02-13 19:47     ` Ricardo Neri
2023-02-07  4:58 ` [PATCH v3 08/10] sched/topology: Remove SHARED_CHILD from ASYM_PACKING Ricardo Neri
2023-03-03 11:29   ` Ionela Voinescu
2023-03-05 19:08     ` Ricardo Neri
2023-03-06 13:10       ` Ionela Voinescu
2023-03-06 18:17         ` Ricardo Neri
2023-02-07  4:58 ` [PATCH v3 09/10] x86/sched: Remove SD_ASYM_PACKING from the SMT domain flags Ricardo Neri
2023-02-07  4:58 ` [PATCH v3 10/10] x86/sched/itmt: Give all SMT siblings of a core the same priority Ricardo Neri
2023-02-09  8:07 ` [PATCH v3 00/10] sched/fair: Avoid unnecessary migrations within SMT domains Zhang, Rui

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=183aec1b-5626-e972-bbed-aca038280828@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=ionela.voinescu@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=ravi.v.shankar@intel.com \
    --cc=ricardo.neri-calderon@linux.intel.com \
    --cc=ricardo.neri@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=tim.c.chen@intel.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=x86@kernel.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

Powered by JetHome