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]
Date:	Wed, 25 Feb 2009 12:45:42 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	"Metzger, Markus T" <markus.t.metzger@...el.com>
Cc:	"hpa@...or.com" <hpa@...or.com>,
	"mingo@...hat.com" <mingo@...hat.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-tip-commits@...r.kernel.org" 
	<linux-tip-commits@...r.kernel.org>
Subject: Re: [tip:tracing/hw-branch-tracing] tracing/hw-branch-tracing:
	convert bts-tracer mutex to a spinlock


* Metzger, Markus T <markus.t.metzger@...el.com> wrote:

> >-----Original Message-----
> >From: Ingo Molnar [mailto:mingo@...e.hu]
> >Sent: Wednesday, February 25, 2009 12:11 PM
> >To: Metzger, Markus T
> >Cc: hpa@...or.com; mingo@...hat.com; tglx@...utronix.de; linux-kernel@...r.kernel.org; linux-tip-
> >commits@...r.kernel.org
> 
> 
> >> And I assume you like the spinlock better than the
> >> get/put_online_cpus(), as well.
> >
> >yeah - and get/put_online_cpus is sleepable too, so it doesnt
> >really help unless i'm missing something ...
> 
> I suggested to use get/put_online_cpus() instead of the lock.
> 
> The hotplug code waits until the cpu_hotplug.refcount is zero
> and it holds the cpu_hotplug.lock during hotplug operations
> (see cpu_hotplug_begin/done()).
> 
> In turn, get_online_cpus() needs to grab the cpu_hotplug.lock
> to increment the cpu_hotplug.refcount.
> 
> Thus, we will use the cpu_hotplug.lock instead of our own lock.

... which, if you use it in the exact same spots as now still 
does a potential sleep with irqs disabled => bad.

We might be able to not take the hotplug lock in the affected 
codepath, but we should really not expand on the use of that 
lock and should make this code self-sufficient.

	Ingo
--
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