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: <20060827005707.e61984a9.akpm@osdl.org>
Date:	Sun, 27 Aug 2006 00:57:07 -0700
From:	Andrew Morton <akpm@...l.org>
To:	dipankar@...ibm.com
Cc:	Linus Torvalds <torvalds@...l.org>, Dave Jones <davej@...hat.com>,
	ego@...ibm.com, rusty@...tcorp.com.au,
	linux-kernel@...r.kernel.org, arjan@...ux.intel.com, mingo@...e.hu,
	vatsa@...ibm.com, ashok.raj@...el.com
Subject: Re: [RFC][PATCH 0/4] Redesign cpu_hotplug locking.

On Sun, 27 Aug 2006 13:07:30 +0530
Dipankar Sarma <dipankar@...ibm.com> wrote:

> On Sat, Aug 26, 2006 at 11:46:18PM -0700, Andrew Morton wrote:
> > On Sun, 27 Aug 2006 11:41:55 +0530
> > 
> > > The right thing to do would be to
> > > do an audit and clean up the bad lock_cpu_hotplug() calls.
> > 
> > No, that won't fix it.  For example, take a look at all the *callers* of
> > cpufreq_update_policy().  AFAICT they're all buggy.  Fiddling with the
> > existing lock_cpu_hotplug() sites won't fix that.  (Possibly this
> > particular problem can be fixed by checking that the relevant CPU is still
> > online after the appropriate locking has been taken - dunno).
> > 
> 
> This is a different issue from the ones that relates to lock_cpu_hotplug().

Well not really.  The thinking goes "gee, we need to lock against CPU
hotplug.  THe CPU hotplug guys gave us lock_cpu_hotplug() so we're supposed
to use that somethere".  We see the result.

> This one seems like a cpufreq internal locking problem.
> 
> On a quick look at this,

Me too.  But fixing this will require a long look.  What per-cpu resources
are being used?  How should they be locked?  Implement.

> it seems to me that cpufreq_cpu_get() should
> do exactly what you said - use a spinlock in each cpufreq_cpu_data[] to
> protect the per-cpu flag and in cpufreq_cpu_get() check if
> !data and data->online == 0. They may have to do - 
> 
> static struct cpufreq_data {
> 	spinlock_t lock;
> 	int flag;
> 	struct cpufreq_policy *policy;
> } cpufreq_cpu_data[NR_CPUS];
> 

I think we're agreeing...  cpufreq locking is busted, needs to be redone
and, I would suggest, fancifying lock_cpu_hotplug() isn't the way to do it.

-
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