public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, lenb@kernel.org, mingo@elte.hu,
	peterz@infradead.org, yanmin_zhang@linux.intel.com,
	torvalds@linux-foundation.org, jens.axboe@oracle.com
Subject: Re: PATCH] cpuidle: A new variant of the menu governor to boost IO performance
Date: Mon, 14 Sep 2009 04:45:10 +0200	[thread overview]
Message-ID: <20090914044510.511d2ac9@infradead.org> (raw)
In-Reply-To: <20090913163007.a1b967c2.akpm@linux-foundation.org>

On Sun, 13 Sep 2009 16:30:07 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> We can't just fix up the existing code?

we could, it'd be just replacing menu.c.
(since the new one started out with menu.c anyway)
I don't mind either way, will replace. 

> > +#define BUCKETS 12
> > +#define RESOLUTION 1024
> > +#define DECAY 4
> > +#define MAX_INTERESTING 50000
> 
> Interesting!  Unobvious what it does though.

at least I documented it:
   * the actual factor is if there is (disk) IO outstanding or not.
   * (as a special twist, we consider every sleep longer than 50 milliseconds
   * as perfect; there is no power gains for sleeping longer than this)

> 
> That's DIV_ROUND_UP().

ok

> > +	new_factor = data->correction_factor[data->bucket]
> > +			* (DECAY - 1) / DECAY;
> 
> This code is available on 32-bit.  I wouldn't be surprised if we see
> some udivdi2-isn't-there problems with some compiler versions.  We'll
> see.

at least not on the ones I tried. DECAY is "4" which means it'll be
shifts anyway (that's not entirely accidental)

> > +
> > +unsigned long this_cpu_load(void)
> > +{
> > +	int this_cpu = smp_processor_id();
> > +	struct rq *this_rq = cpu_rq(this_cpu);
> > +	return this_rq->cpu_load[0];
> > +}
> 
> hm, how come we don't get smp_processor_id-in-preemptible warnings. 
> Are all current callers pinned to a CPU?

the idle loop is pinned by definition, and also runs with irqs off

"all current callers".. this is a new function, with menutng being the
only caller. I'm fine with requiring all callers to be pinned, it's
*this* cpu's load after all ;-)



> 
> 
> some spelling fixlets:

never been my strong point (esp when jetlagged); thanks!


-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

  reply	other threads:[~2009-09-14  2:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 15:40 PATCH] cpuidle: A new variant of the menu governor to boost IO performance Arjan van de Ven
2009-09-11 16:37 ` Jens Axboe
2009-09-11 19:16 ` John Stoffel
2009-09-11 19:51   ` Arjan van de Ven
2009-09-14  3:30   ` Zhang, Yanmin
2009-09-11 22:03 ` Matthew Garrett
2009-09-12  3:26   ` Arjan van de Ven
2009-09-12 11:39     ` Matthew Garrett
2009-09-12 14:04       ` Arjan van de Ven
2009-09-13 23:30 ` Andrew Morton
2009-09-14  2:45   ` Arjan van de Ven [this message]
2009-09-14  7:43 ` Andrew Morton
2009-09-14  8:04   ` Tejun Heo
2009-09-14  8:15     ` Peter Zijlstra
2009-09-14  9:09       ` Tejun Heo
2009-09-14 20:31   ` Arjan van de Ven

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=20090914044510.511d2ac9@infradead.org \
    --to=arjan@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=jens.axboe@oracle.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=yanmin_zhang@linux.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