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  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]
Date:	Tue, 14 Oct 2014 19:18:25 +0000
From:	"Elliott, Robert (Server Storage)" <>
To:	Prarit Bhargava <>,
	Viresh Kumar <>
CC:	Saravana Kannan <>,
	"Rafael J. Wysocki" <>,
	"" <>,
	Linux Kernel <>,
	Robert Schöne <>
Subject: RE: Locking issues with cpufreq and sysfs

> -----Original Message-----
> From: [mailto:linux-kernel-
>] On Behalf Of Prarit Bhargava
> Sent: Tuesday, 14 October, 2014 1:24 PM
> To: Viresh Kumar
> Cc: Saravana Kannan; Rafael J. Wysocki;; Linux
> Kernel; Robert Schöne
> Subject: Re: Locking issues with cpufreq and sysfs
> On 10/14/2014 03:10 AM, Viresh Kumar wrote:
> > On 13 October 2014 18:41, Prarit Bhargava <> wrote:
> >>
> >> The locking is insufficient here, Viresh.  I no longer believe that fixes
> >> to this locking scheme are the right way to move forward here.  I'm
> wondering
> >> if we can look at other alternatives such as maintaining a refcount or
> >> perhaps using a queuing mechanism for governor and policy related changes.
> >>
> So I'm proposing that we move to a single threaded read/write using, if
> possible, a single policy lock for now.  We might transition this back to a
> rwsem later on, however, for the first attempt at cleaning this up I think we
> should just stick with a simple lock.  In doing that, IMO we remove
> cpufreq_rwsem: protects the driver from being unloaded
> cpufreq_governor_lock: protects the current governor
> each policy has a rwsem (policy->rwsem): protects the cpufreq_policy struct
> and potentially
> cpufreq_driver_lock: protects the cpufreq_cpu_data array and cpufreq_driver-
> >boost
> After looking at the way the code would be structured, I'm wondering if
> cpufreq_governor_mutex: protects the cpufreq_governor_list
> is overkill.  The loading of a module should be atomic relative to the
> cpufreq code, so this lock may not be required.  (Admittedly I haven't
> tested that...)
> That would leave:
> global_kobj_lock: protects the "cpufreq" kobject
> each policy has a transition_lock (policy->transition): synchronizes
>                                                         frequency transitions
> and a new lock, perhaps called policy->lock, to serialize all events.

Please keep performance in mind too.  cpufreq_governor_lock
contention is a bit of an issue with heavy IO workloads
as described in:

Rob Elliott    HP Server Storage

Powered by blists - more mailing lists