mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Venki Pallipadi <venki@google.com>,
	Andi Kleen <andi@firstfloor.org>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	Ingo Molnar <mingo@elte.hu>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Patch] Idle balancer: cache align nohz structure to improve idle load balancing scalability
Date: Mon, 14 Nov 2011 11:37:49 -0800	[thread overview]
Message-ID: <1321299469.16760.5.camel@sbsiddha-desk.sc.intel.com> (raw)
In-Reply-To: <1321263161.30500.7.camel@twins>

On Mon, 2011-11-14 at 01:32 -0800, Peter Zijlstra wrote:
> On Tue, 2011-11-01 at 16:52 -0700, Suresh Siddha wrote:
> > @@ -3317,6 +3317,7 @@ static void update_cpu_power(struct sched_domain *sd, int cpu)
> >  
> >         cpu_rq(cpu)->cpu_power = power;
> >         sdg->sgp->power = power;
> > +       atomic_set(&sdg->sgp->nr_busy_cpus, sdg->group_weight);
> >  }
> >  
> >  static void update_group_power(struct sched_domain *sd, int cpu)
> > @@ -3339,6 +3340,7 @@ static void update_group_power(struct sched_domain *sd, int cpu)
> >         } while (group != child->groups);
> >  
> >         sdg->sgp->power = power;
> > +       atomic_set(&sdg->sgp->nr_busy_cpus, sdg->group_weight);
> >  } 
> 
> So we run this rather frequently, and it will trample all over:
> 
> > +                */
> > +               for_each_domain(cpu, sd)
> > +                       atomic_dec(&sd->groups->sgp->nr_busy_cpus);
> 
> because I cannot see any serialization between those sites.

That was an overlook from myside. I moved the initialization of this to
init_sched_groups_power() now and there is no need to re-do this
everytime we call the update_group_power().

> Also, isn't it rather weird to just assume all cpus are busy in
> update_group_power()? If you would actually set the right value in
> update_cpu_power() you could use a straight sum in update_group_power()
> and get a more or less accurate number out.

I will post an updated patch soon (once we complete the performance
analysis of this patch with respect to other workloads) but the below
hunk gives an idea of what I am planning to do now.

@@ -7369,6 +7384,7 @@ static void init_sched_groups_power(int cpu, struct sched_
                return;
 
        update_group_power(sd, cpu);
+       atomic_set(&sg->sgp->nr_busy_cpus, sg->group_weight);
 }
 
 /*

thanks,
suresh


      reply	other threads:[~2011-11-14 19:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-19 21:45 Tim Chen
2011-10-20  4:18 ` Eric Dumazet
2011-10-20  5:57   ` Suresh Siddha
2011-10-20  6:43     ` Eric Dumazet
2011-10-20 17:19   ` Tim Chen
2011-10-20  4:24 ` Andi Kleen
2011-10-20 12:26   ` Venki Pallipadi
2011-10-20 17:31     ` Suresh Siddha
2011-10-20 17:38     ` Peter Zijlstra
     [not found]     ` <4FF5AC937153B0459463C1A88EB478F20135D6ECB5@orsmsx505.amr.corp.intel.com>
2011-11-01 23:52       ` Suresh Siddha
2011-11-02 13:04         ` Srivatsa Vaddagiri
2011-11-02 13:54         ` Srivatsa Vaddagiri
2011-11-02 15:13           ` Suresh Siddha
2011-11-14  9:32         ` Peter Zijlstra
2011-11-14 19:37           ` Suresh Siddha [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=1321299469.16760.5.camel@sbsiddha-desk.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tim.c.chen@linux.intel.com \
    --cc=venki@google.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®