public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: mark gross <markgross@thegnar.org>
Cc: Tim Chen <tim.c.chen@linux.intel.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	James Bottomley <James.Bottomley@suse.de>,
	David Alan Gilbert <linux@treblig.org>,
	linux-kernel@vger.kernel.org, Len <len.brown@intel.com>,
	Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [Patch] idle governor: Avoid lock acquisition to read pm_qos before entering idle
Date: Thu, 10 Feb 2011 08:20:37 -0800	[thread overview]
Message-ID: <20110210162037.GA19389@tassilo.jf.intel.com> (raw)
In-Reply-To: <20110210051042.GC4897@gvim.org>

On Wed, Feb 09, 2011 at 09:10:42PM -0800, mark gross wrote:
> On Wed, Feb 09, 2011 at 05:21:04PM -0800, Tim Chen wrote:
> > I noticed that before entering idle state, the menu idle governor will
> > look up the current pm_qos value according to the list of qos request
> > received.  This look up currently needs the acquisition of a lock to go
> > down a list of qos requests to find the qos value, slowing down the
> 
> wait a second... It gets the target_value (that is an atomic variable)
> humpf.  I was looking at 2.6.35, where this is true.  If you want to put
> back a target_value why not put it back the way it was?

I don't think the goal is to make the code look like it was before,
just to have clean and scalable code going forwards.

> I'm surprised by this as the last update to the pm_qos replaced the
> lists with a O(1) data structure so there was no more walking of pending
> requests.
> 
> What is the profile after the patch the Plist should be only one
> dereference and an if instruction slower than a cached value.

The problem with the plist is that you need to take a lock for reading
the first value. The lock is a performance problem on servers.
The reference doesn't matter at all.

> Does your patch remove the need for the locks because if it doesn't I
> don't see how it will make much of a difference?

The value itself doesn't need a lock, just the list access.

> 
> > Perhaps a better approach will be to cache the updated pm_qos value so
> > reading it does not require lock acquisition as in the patch below.   
> 
> See v2.6.35 for an possible instance of the better approach.

Tim's new code seems simpler and cleaner than what was in .35.

-Andi

  reply	other threads:[~2011-02-10 16:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-10  1:21 [Patch] idle governor: Avoid lock acquisition to read pm_qos before entering idle Tim Chen
2011-02-10  3:46 ` Andi Kleen
2011-02-10 18:59   ` Rafael J. Wysocki
2011-02-10  5:10 ` mark gross
2011-02-10 16:20   ` Andi Kleen [this message]
2011-02-10 17:27   ` Tim Chen
2011-02-10 17:45 ` James Bottomley
2011-02-10 18:50   ` Rafael J. Wysocki
2011-02-10 19:33   ` Tim Chen
2011-02-10 20:37     ` James Bottomley
2011-02-10 17:55 ` mark gross
2011-02-10 23:17 ` Rafael J. Wysocki
2011-02-11  0:50   ` Tim Chen
2011-02-11 19:22     ` Rafael J. Wysocki
2011-02-11 19:27       ` Tim Chen
2011-02-11 19:33         ` James Bottomley
2011-02-11 20:03           ` Tim Chen

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=20110210162037.GA19389@tassilo.jf.intel.com \
    --to=ak@linux.intel.com \
    --cc=James.Bottomley@suse.de \
    --cc=arjan@linux.intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@treblig.org \
    --cc=markgross@thegnar.org \
    --cc=rjw@sisk.pl \
    --cc=tim.c.chen@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