lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110210162037.GA19389@tassilo.jf.intel.com>
Date:	Thu, 10 Feb 2011 08:20:37 -0800
From:	Andi Kleen <ak@...ux.intel.com>
To:	mark gross <markgross@...gnar.org>
Cc:	Tim Chen <tim.c.chen@...ux.intel.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	James Bottomley <James.Bottomley@...e.de>,
	David Alan Gilbert <linux@...blig.org>,
	linux-kernel@...r.kernel.org, Len <len.brown@...el.com>,
	Arjan van de Ven <arjan@...ux.intel.com>
Subject: Re: [Patch] idle governor: Avoid lock acquisition to read pm_qos
 before entering idle

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ