From: Preeti U Murthy <preeti@linux.vnet.ibm.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Alex Shi <alex.shi@intel.com>,
Mike Galbraith <bitbucket@online.de>,
LKML <linux-kernel@vger.kernel.org>,
"svaidy@linux.vnet.ibm.com" <svaidy@linux.vnet.ibm.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Viresh Kumar <viresh.kumar@linaro.org>,
Amit Kucheria <amit.kucheria@linaro.org>,
Morten Rasmussen <Morten.Rasmussen@arm.com>,
Paul McKenney <paul.mckenney@linaro.org>,
Andrew Morton <akpm@linux-foundation.org>,
Arjan van de Ven <arjan@linux.intel.com>,
Ingo Molnar <mingo@kernel.org>, Paul Turner <pjt@google.com>,
Venki Pallipadi <venki@google.com>,
Robin Randhawa <robin.randhawa@arm.com>,
Lists linaro-dev <linaro-dev@lists.linaro.org>,
Matthew Garrett <mjg59@srcf.ucam.org>,
srikar@linux.vnet.ibm.com
Subject: Re: sched: Consequences of integrating the Per Entity Load Tracking Metric into the Load Balancer
Date: Thu, 17 Jan 2013 15:46:38 +0530 [thread overview]
Message-ID: <50F7CF86.8050101@linux.vnet.ibm.com> (raw)
In-Reply-To: <87k3rcl75q.fsf@sejong.aot.lge.com>
Hi Namhyung,
>> I re-written the patch as following. hackbench/aim9 doest show clean performance change.
>> Actually we can get some profit. it also will be very slight. :)
>> BTW, it still need another patch before apply this. Just to show the logical.
>>
>> ===========
>>> From 145ff27744c8ac04eda056739fe5aa907a00877e Mon Sep 17 00:00:00 2001
>> From: Alex Shi <alex.shi@intel.com>
>> Date: Fri, 11 Jan 2013 16:49:03 +0800
>> Subject: [PATCH 3/7] sched: select_idle_sibling optimization
>>
>> Current logical in this function will insist to wake up the task in a
>> totally idle group, otherwise it would rather back to previous cpu.
>
> Or current cpu depending on result of wake_affine(), right?
>
>>
>> The new logical will try to wake up the task on any idle cpu in the same
>> cpu socket (in same sd_llc), while idle cpu in the smaller domain has
>> higher priority.
>
> But what about SMT domain?
The previous approach also descended till the SMT domain.Here we start
from the SMT domain.
You could check with /proc/schedstat as to which are the different
domains the cpu is a part of and SMT domain happens to be domain0.As far
as i know for_each_lower_domain will descend till domain0.
>
> I mean it seems that the code prefers running a task on a idle cpu which
> is a sibling thread in the same core rather than running it on an idle
> cpu in another idle core. I guess we didn't do that before.
>
>>
>> It should has some help on burst wake up benchmarks like aim7.
>>
>> Original-patch-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
>> Signed-off-by: Alex Shi <alex.shi@intel.com>
>> ---
>> kernel/sched/fair.c | 40 +++++++++++++++++++---------------------
>> 1 files changed, 19 insertions(+), 21 deletions(-)
>>
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index e116215..fa40e49 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -3253,13 +3253,13 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
>> /*
>> * Try and locate an idle CPU in the sched_domain.
>> */
>> -static int select_idle_sibling(struct task_struct *p)
>> +static int select_idle_sibling(struct task_struct *p,
>> + struct sched_domain *affine_sd, int sync)
>
> Where are these arguments used?
>
>
>> {
>> int cpu = smp_processor_id();
>> int prev_cpu = task_cpu(p);
>> struct sched_domain *sd;
>> struct sched_group *sg;
>> - int i;
>>
>> /*
>> * If the task is going to be woken-up on this cpu and if it is
>> @@ -3281,27 +3281,25 @@ static int select_idle_sibling(struct task_struct *p)
>> /*
>> * Otherwise, iterate the domains and find an elegible idle cpu.
>> */
>> - sd = rcu_dereference(per_cpu(sd_llc, prev_cpu));
>> - for_each_lower_domain(sd) {
>> + for_each_domain(prev_cpu, sd) {
>
> Always start from the prev_cpu?
>
>
>> sg = sd->groups;
>> do {
>> - if (!cpumask_intersects(sched_group_cpus(sg),
>> - tsk_cpus_allowed(p)))
>> - goto next;
>> -
>> - for_each_cpu(i, sched_group_cpus(sg)) {
>> - if (!idle_cpu(i))
>> - goto next;
>> - }
>> -
>> - prev_cpu = cpumask_first_and(sched_group_cpus(sg),
>> - tsk_cpus_allowed(p));
>> - goto done;
>> -next:
>> - sg = sg->next;
>> - } while (sg != sd->groups);
>> + int nr_busy = atomic_read(&sg->sgp->nr_busy_cpus);
>> + int i;
>> +
>> + /* no idle cpu in the group */
>> + if (nr_busy == sg->group_weight)
>> + continue;
>
> Maybe we can skip local group since it's a bottom-up search so we know
> there's no idle cpu in the lower domain from the prior iteration.
We could have done this for the current logic because it checks for an
*idle* group.The local group would definitely fail this test.But here we
need to check the local group also because we are looking for an idle cpu.
Regards
Preeti U Murthy
next prev parent reply other threads:[~2013-01-17 10:17 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-02 4:22 sched: Consequences of integrating the Per Entity Load Tracking Metric into the Load Balancer Preeti U Murthy
2013-01-02 8:12 ` Mike Galbraith
2013-01-03 10:38 ` Preeti U Murthy
2013-01-03 20:06 ` Mike Galbraith
2013-01-04 11:41 ` Mike Galbraith
2013-01-05 8:13 ` Mike Galbraith
2013-01-06 16:32 ` Mike Galbraith
2013-01-07 5:29 ` Preeti U Murthy
2013-01-07 7:36 ` Mike Galbraith
2013-01-08 8:41 ` Preeti U Murthy
2013-01-16 14:08 ` Alex Shi
2013-01-17 5:17 ` Namhyung Kim
2013-01-17 10:16 ` Preeti U Murthy [this message]
2013-01-17 13:41 ` Alex Shi
2013-01-24 3:13 ` Alex Shi
2013-01-17 8:45 ` Preeti U Murthy
2013-01-07 15:48 ` Vincent Guittot
2013-01-08 6:06 ` Preeti U Murthy
2013-01-08 14:04 ` Vincent Guittot
2013-01-09 3:14 ` Preeti U Murthy
2013-01-20 15:30 ` Alex Shi
2013-01-20 15:52 ` Alex Shi
2013-01-21 2:40 ` Preeti U Murthy
2013-01-21 3:26 ` Alex Shi
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=50F7CF86.8050101@linux.vnet.ibm.com \
--to=preeti@linux.vnet.ibm.com \
--cc=Morten.Rasmussen@arm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=alex.shi@intel.com \
--cc=amit.kucheria@linaro.org \
--cc=arjan@linux.intel.com \
--cc=bitbucket@online.de \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=namhyung@kernel.org \
--cc=paul.mckenney@linaro.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=pjt@google.com \
--cc=robin.randhawa@arm.com \
--cc=srikar@linux.vnet.ibm.com \
--cc=svaidy@linux.vnet.ibm.com \
--cc=venki@google.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@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.