public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Michael Wang <wangyun@linux.vnet.ibm.com>,
	mingo@redhat.com, linaro-kernel@lists.linaro.org,
	patches@linaro.org, linux-kernel@vger.kernel.org,
	robin.randhawa@arm.com, Steve.Bannister@arm.com,
	Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com,
	arvind.chauhan@arm.com
Subject: Re: [PATCH 1/2] sched: Optimize build_sched_domains() for saving first SD node for a cpu
Date: Wed, 5 Jun 2013 13:04:34 +0200	[thread overview]
Message-ID: <20130605110434.GY8923@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKohpokGrgFOtOT6Y3e4MOJBUQWT4FG4Mk-F6_M0V-pEEf3KYw@mail.gmail.com>

On Wed, Jun 05, 2013 at 10:37:29AM +0530, Viresh Kumar wrote:
> On 5 June 2013 10:12, Michael Wang <wangyun@linux.vnet.ibm.com> wrote:
> > Hi, Viresh
> >
> > On 06/04/2013 07:20 PM, Viresh Kumar wrote:
> > [snip]
> >> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> >> index 58453b8..638f6cb 100644
> >> --- a/kernel/sched/core.c
> >> +++ b/kernel/sched/core.c
> >> @@ -6533,16 +6533,13 @@ static int build_sched_domains(const struct cpumask *cpu_map,
> >>               sd = NULL;
> >>               for (tl = sched_domain_topology; tl->init; tl++) {
> >>                       sd = build_sched_domain(tl, &d, cpu_map, attr, sd, i);
> >> +                     if (!*per_cpu_ptr(d.sd, i))
> >
> > What about:
> >                         if (tl == sched_domain_topology)
> >
> > It cost less than per_cpu_ptr(), isn't it?
> 
> How can I miss it.. Obviously its better :)
> 
> See if below one looks better (Attached too in case gmail screws up
> my mail)..
> 
> --------x-------------x------------------
> 
> From: Viresh Kumar <viresh.kumar@linaro.org>
> Date: Tue, 4 Jun 2013 15:41:15 +0530
> Subject: [PATCH] sched: Optimize build_sched_domains() for saving first SD
>  node for a cpu
> 
> We are saving first scheduling domain for a cpu in build_sched_domains() by
> iterating over the nested sd->child list. We don't actually need to do it this
> way.
> 
> tl will be equal to sched_domain_topology for the first iteration and so we can
> set *per_cpu_ptr(d.sd, i) based on that.  So, save pointer to first SD while
> running the iteration loop over tl's.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  kernel/sched/core.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 58453b8..08a27be 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -6533,16 +6533,13 @@ static int build_sched_domains(const struct
> cpumask *cpu_map,

Applying patch
patches/viresh_kumar-_patch__sched-optimize_build_sched_domains_for_saving_first_sd.patch
patching file kernel/sched/core.c
patch: **** malformed patch at line 56: cpumask *cpu_map,


  parent reply	other threads:[~2013-06-05 11:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-04 11:20 [PATCH 1/2] sched: Optimize build_sched_domains() for saving first SD node for a cpu Viresh Kumar
2013-06-04 11:20 ` [PATCH 2/2] sched: Remove unused params of build_sched_domain() Viresh Kumar
2013-06-05  4:42 ` [PATCH 1/2] sched: Optimize build_sched_domains() for saving first SD node for a cpu Michael Wang
2013-06-05  5:07   ` Viresh Kumar
2013-06-05  5:26     ` Michael Wang
2013-06-05 11:04     ` Peter Zijlstra [this message]
2013-06-05 12:42       ` Viresh Kumar
2013-06-05 13:03         ` Peter Zijlstra

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=20130605110434.GY8923@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Liviu.Dudau@arm.com \
    --cc=Steve.Bannister@arm.com \
    --cc=arvind.chauhan@arm.com \
    --cc=charles.garcia-tobin@arm.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=patches@linaro.org \
    --cc=robin.randhawa@arm.com \
    --cc=viresh.kumar@linaro.org \
    --cc=wangyun@linux.vnet.ibm.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