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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090225095814.GC12352@elte.hu>
Date:	Wed, 25 Feb 2009 10:58:14 +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:

> > static void trace_bts_prepare(struct trace_iterator *iter)
> > {
> >-	mutex_lock(&bts_tracer_mutex);
> >+	spin_lock(&bts_tracer_lock);
> >
> > 	on_each_cpu(trace_bts_cpu, iter->tr, 1);
> >
> >-	mutex_unlock(&bts_tracer_mutex);
> >+	spin_unlock(&bts_tracer_lock);
> > }
> 
> Whereas start/stop are relatively fast, the above operation is 
> rather expensive. Would it make sense to use 
> schedule_on_each_cpu() instead of on_each_cpu()?

it's perfectly fine to do that on_each_cpu() under the spinlock. 
schedule_on_each_cpu() would likely be more expensive - and for 
no good reason.

	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