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>] [day] [month] [year] [list]
Date:	Sat, 15 Nov 2014 21:00:07 -0500
From:	Pranith Kumar <bobby.prani@...il.com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	linux-pm@...r.kernel.org (open list:CPUIDLE DRIVERS),
	linux-kernel@...r.kernel.org (open list)
Subject: [RFC PATCH] cpuidle: Use a lighter barrier in snooze_loop()

Using smp_mb() here so that the bit clear is not reordered is an overkill.

It is more appropriate to use smp_mb__after_atomic() which ensures that the
bit clear is not reordered.

Signed-off-by: Pranith Kumar <bobby.prani@...il.com>
---
 drivers/cpuidle/cpuidle-powernv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c
index 7d3a349..b0bfcbe 100644
--- a/drivers/cpuidle/cpuidle-powernv.c
+++ b/drivers/cpuidle/cpuidle-powernv.c
@@ -48,7 +48,8 @@ static int snooze_loop(struct cpuidle_device *dev,
 	HMT_medium();
 	ppc64_runlatch_on();
 	clear_thread_flag(TIF_POLLING_NRFLAG);
-	smp_mb();
+	/* ensure bit clear is not reordered */
+	smp_mb__after_atomic();
 	return index;
 }
 
-- 
1.9.1

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