public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, suresh.b.siddha@intel.com,
	venkatesh.pallipadi@intel.com, a.p.zijlstra@chello.nl,
	dipankar@in.ibm.com, balbir@linux.vnet.ibm.com,
	vatsa@linux.vnet.ibm.com, ego@in.ibm.com, andi@firstfloor.org,
	davecb@sun.com, tconnors@astro.swin.edu.au, maxk@qualcomm.com,
	gregory.haskins@gmail.com, pavel@suse.cz
Subject: Re: [PATCH v6 6/7] sched: add SD_BALANCE_NEWIDLE at MC and CPU level for sched_mc>0
Date: Thu, 18 Dec 2008 20:52:30 +0530	[thread overview]
Message-ID: <20081218152230.GA22463@dirshya.in.ibm.com> (raw)
In-Reply-To: <20081218124644.GA31733@elte.hu>

* Ingo Molnar <mingo@elte.hu> [2008-12-18 13:46:44]:

> 
> * Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> wrote:
> 
> > * Andrew Morton <akpm@linux-foundation.org> [2008-12-17 17:42:54]:
> > 
> > > On Wed, 17 Dec 2008 22:57:38 +0530
> > > Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> wrote:
> > > 
> > > > --- a/include/linux/sched.h
> > > > +++ b/include/linux/sched.h
> > > > @@ -782,6 +782,16 @@ enum powersavings_balance_level {
> > > >  	((sched_mc_power_savings || sched_smt_power_savings) ?	\
> > > >  	 SD_POWERSAVINGS_BALANCE : 0)
> > > 
> > > What's with all the crappy macros in here?
> > 
> > Hi Andrew,
> > 
> > These macros set the SD_POWERSAVINGS_BALANCE flag based on the
> > sysfs tunable.
> >  
> > > > +/*
> > > > + * Optimise SD flags for power savings:
> > > > + * SD_BALANCE_NEWIDLE helps agressive task consolidation and power savings.
> > > > + * Keep default SD flags if sched_{smt,mc}_power_saving=0
> > > > + */
> > > > +
> > > > +#define POWERSAVING_SD_FLAGS	\
> > > > +	((sched_mc_power_savings || sched_smt_power_savings) ?	\
> > > > +	  SD_BALANCE_NEWIDLE : 0)
> > > 
> > > This one purports to be a constant, but it isn't - it's code.
> > > 
> > > It would be cleaner, clearer and more idiomatic to do
> > > 
> > > static inline int powersaving_sd_flags(void)
> > > {
> > > 	...
> > > }
> > 
> > Your are suggesting to move these to inline functions.   I will write
> > a patch and post for review.
> >  
> > > Also, doing (sched_mc_power_savings | sched_smt_power_saving) might
> > > save a branch.
> > > 
> > > >  #define test_sd_parent(sd, flag)	((sd->parent &&		\
> > > >  					 (sd->parent->flags & flag)) ? 1 : 0)
> > > 
> > > buggy when passed an expression with side-effects.  Doesn't need to be
> > > implemented as a macro.
> > 
> > Agreed, but these macros are used throughout sched.c and are performance 
> > sensitive.  Inline functions are a close enough replacement for the 
> > macro let me look for any performance penalty as well and report.
> 
> those macros are historic so feel free to convert them to inlines without 
> re-measuring performance impact.

Sure Ingo.  I will go ahead and change them in my next iteration.
 
> The patchset looks pretty good in principle otherwise, so if you could 
> address Andrew's comments and clean up those bits in the next iteration we 
> could start testing it in the scheduler tree. (Please also add Balbir 
> Singh's acks to the next iteration.)

Thank you for acking the patch.  I will address Andrew's comments and
post the next iteration along with Balbir's acks.

> and please fix your mailer to not inject stuff like this:
> 
>  Mail-Followup-To: Andrew Morton <akpm@linux-foundation.org>,
>         linux-kernel@vger.kernel.org, suresh.b.siddha@intel.com,
>         venkatesh.pallipadi@intel.com, a.p.zijlstra@chello.nl,
>         mingo@elte.hu, dipankar@in.ibm.com, balbir@linux.vnet.ibm.com,
>         vatsa@linux.vnet.ibm.com, ego@in.ibm.com, andi@firstfloor.org,
>         davecb@sun.com, tconnors@astro.swin.edu.au, maxk@qualcomm.com,
>         gregory.haskins@gmail.com, pavel@suse.cz
> 
> It utterly messed up the addressing mode of my reply here and i had to 
> edit the raw email headers manually to fix it up ;-)

OOPS! My bad mutt config!  I have tried to fix this.  Hopefully this
will not cause trouble anymore.

Thanks,
Vaidy

  reply	other threads:[~2008-12-18 15:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17 17:26 [PATCH v6 0/7] Tunable sched_mc_power_savings=n Vaidyanathan Srinivasan
2008-12-17 17:26 ` [PATCH v6 1/7] sched: Framework for sched_mc/smt_power_savings=N Vaidyanathan Srinivasan
2008-12-17 18:10   ` Balbir Singh
2008-12-17 17:26 ` [PATCH v6 2/7] sched: favour lower logical cpu number for sched_mc balance Vaidyanathan Srinivasan
2008-12-17 18:09   ` Balbir Singh
2008-12-17 17:26 ` [PATCH v6 3/7] sched: nominate preferred wakeup cpu Vaidyanathan Srinivasan
2008-12-17 17:27 ` [PATCH v6 4/7] sched: bias task wakeups to preferred semi-idle packages Vaidyanathan Srinivasan
2008-12-17 17:27 ` [PATCH v6 5/7] sched: activate active load balancing in new idle cpus Vaidyanathan Srinivasan
2008-12-17 17:27 ` [PATCH v6 6/7] sched: add SD_BALANCE_NEWIDLE at MC and CPU level for sched_mc>0 Vaidyanathan Srinivasan
2008-12-18  1:42   ` Andrew Morton
2008-12-18  9:35     ` Vaidyanathan Srinivasan
2008-12-18 12:46       ` Ingo Molnar
2008-12-18 15:22         ` Vaidyanathan Srinivasan [this message]
2008-12-17 17:27 ` [PATCH v6 7/7] sched: idle_balance() does not call load_balance_newidle() Vaidyanathan Srinivasan

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=20081218152230.GA22463@dirshya.in.ibm.com \
    --to=svaidy@linux.vnet.ibm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=davecb@sun.com \
    --cc=dipankar@in.ibm.com \
    --cc=ego@in.ibm.com \
    --cc=gregory.haskins@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxk@qualcomm.com \
    --cc=mingo@elte.hu \
    --cc=pavel@suse.cz \
    --cc=suresh.b.siddha@intel.com \
    --cc=tconnors@astro.swin.edu.au \
    --cc=vatsa@linux.vnet.ibm.com \
    --cc=venkatesh.pallipadi@intel.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