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:	Tue, 5 Jun 2007 11:38:27 -0700
From:	"Luck, Tony" <tony.luck@...el.com>
To:	"Heiko Carstens" <heiko.carstens@...ibm.com>,
	<linux-kernel@...r.kernel.org>, <linux-arch@...r.kernel.org>
Subject: RE: volatile and atomic_t/spinlock_t

> So is
>
>	while (__raw_spin_is_locked(&v));
>
> supposed to work? Or should that be 
>
>	while (__raw_spin_is_locked(&v))
>		cpu_relax();
>
> as well and all the volatiles can/should go away?

cpu_relax() is a really good idea in every spinloop on
hyper-threaded cores.  It lets the h/w know that we aren't
doing anything useful here, so resources and power can be
diverted to other threads sharing the core.

Avoiding the need for volatile or other compiler optimizer
defeating tricks is a side benefit.

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