All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rohit Jain <rohit.k.jain@oracle.com>
To: Joel Fernandes <joelaf@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	steven.sistare@oracle.com, dhaval.giani@oracle.com,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Morten Rasmussen <morten.rasmussen@arm.com>,
	"Cc: EAS Dev" <eas-dev@lists.linaro.org>
Subject: Re: [RESEND PATCH] sched/fair: consider RT/IRQ pressure in select_idle_sibling
Date: Wed, 31 Jan 2018 09:50:56 -0800	[thread overview]
Message-ID: <c78b1dab-95fb-ed88-30de-b4d489a5fc17@oracle.com> (raw)
In-Reply-To: <CAJWu+orYPDy3H2TCtB_FZWrMx18F_ePnD=Gdfj=pKg4HVaLjTQ@mail.gmail.com>

On 01/30/2018 05:57 PM, Joel Fernandes wrote:

<snip>
>>>> Signed-off-by: Rohit Jain<rohit.k.jain@oracle.com>
>>>> ---
>>>>    kernel/sched/fair.c | 38 ++++++++++++++++++++++++++++----------
>>>>    1 file changed, 28 insertions(+), 10 deletions(-)
>>>>
>>>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>>>> index 26a71eb..ce5ccf8 100644
>>>> --- a/kernel/sched/fair.c
>>>> +++ b/kernel/sched/fair.c
>>>> @@ -5625,6 +5625,11 @@ static unsigned long capacity_orig_of(int cpu)
>>>>           return cpu_rq(cpu)->cpu_capacity_orig;
>>>>    }
>>>>
>>>> +static inline bool full_capacity(int cpu)
>>>> +{
>>>> +       return capacity_of(cpu) >= (capacity_orig_of(cpu)*3)/4;
>>>> +}
>>>> +
>>>>    static unsigned long cpu_avg_load_per_task(int cpu)
>>>>    {
>>>>           struct rq *rq = cpu_rq(cpu);
>>>> @@ -6081,7 +6086,7 @@ static int select_idle_core(struct task_struct *p,
>>>> struct sched_domain *sd, int
>>>>
>>>>                   for_each_cpu(cpu, cpu_smt_mask(core)) {
>>>>                           cpumask_clear_cpu(cpu, cpus);
>>>> -                       if (!idle_cpu(cpu))
>>>> +                       if (!idle_cpu(cpu) || !full_capacity(cpu))
>>>>                                   idle = false;
>>>>                   }
>>> There's some difference in logic between select_idle_core and
>>> select_idle_cpu as far as the full_capacity stuff you're adding goes.
>>> In select_idle_core, if all CPUs are !full_capacity, you're returning
>>> -1. But in select_idle_cpu you're returning the best idle CPU that's
>>> the most cap among the !full_capacity ones. Why there is this
>>> different in logic? Did I miss something?
>>>

<snip>

> Dude :) That is hardly an answer to the question I asked. Hint:
> *different in logic*.

Let me re-try :)

For select_idle_core, we are doing a search for a fully idle and full
capacity core, the fail-safe is select_idle_cpu because we will re-scan
the CPUs. The notion is to select an idle CPU no matter what, because
being on an idle CPU is better than waiting on a non-idle one. In
select_idle_core you can be slightly picky about the core because
select_idle_cpu is a fail safe. I measured the performance impact of
choosing the "best among low cap" vs the code changes I have (for
select_idle_core) and could not find a statistically significant impact,
hence went with the simpler code changes.

Hope I answered your question.

Thanks,
Rohit

  reply	other threads:[~2018-01-31 17:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29 23:27 [RESEND PATCH] sched/fair: consider RT/IRQ pressure in select_idle_sibling Rohit Jain
2018-01-30  3:39 ` Joel Fernandes
2018-01-30 19:47   ` Rohit Jain
2018-01-31  1:57     ` Joel Fernandes
2018-01-31 17:50       ` Rohit Jain [this message]
2018-02-06  6:50         ` Joel Fernandes
2018-02-06  6:51           ` Joel Fernandes
2018-02-06 17:41           ` Rohit Jain
2018-02-09 12:37           ` Peter Zijlstra
2018-02-06  6:42     ` Joel Fernandes
2018-02-06 17:36       ` Rohit Jain
2018-02-09 12:35   ` Peter Zijlstra
2018-02-09 12:53 ` Peter Zijlstra
2018-02-09 15:46   ` Dietmar Eggemann
2018-02-09 22:05     ` Rohit Jain
2018-02-14  9:11       ` Dietmar Eggemann
2018-02-09 22:17   ` Rohit Jain
2018-03-10 20:41   ` Rohit Jain

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=c78b1dab-95fb-ed88-30de-b4d489a5fc17@oracle.com \
    --to=rohit.k.jain@oracle.com \
    --cc=dhaval.giani@oracle.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=eas-dev@lists.linaro.org \
    --cc=joelaf@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=steven.sistare@oracle.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 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.