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]
Date:	Tue, 3 Oct 2006 23:24:27 -0400
From:	Andrew James Wade <andrew.j.wade@...il.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	tim.c.chen@...ux.intel.com, herbert@...dor.apana.org.au,
	linux-kernel@...r.kernel.org, leonid.i.ananiev@...el.com
Subject: Re: [PATCH] Fix WARN_ON / WARN_ON_ONCE regression

On Tuesday 03 October 2006 21:14, Andrew Morton wrote:
> There are changes here: in the old code we'll avoid reading the static
> variable.  In the new code we'll read the static variable, but we'll avoid
> evaluating the condition.

Tim Chen's patch goes back to the old behaviour. I suspect the cache
misses on __warn_once is what he is measuring. If so, the (untested)
patch below should reduce the cache misses back to those of the old
code.

signed-off-by: Andrew Wade <andrew.j.wade@...il.com>
diff -rupN a/include/asm-generic/bug.h b/include/asm-generic/bug.h
--- a/include/asm-generic/bug.h	2006-10-03 13:58:40.000000000 -0400
+++ b/include/asm-generic/bug.h	2006-10-03 23:17:37.000000000 -0400
@@ -45,9 +45,10 @@
 	static int __warn_once = 1;			\
 	typeof(condition) __ret_warn_once = (condition);\
 							\
-	if (likely(__warn_once))			\
-		if (WARN_ON(__ret_warn_once)) 		\
+	if (unlikely(__ret_warn_once) && __warn_once) {	\
 			__warn_once = 0;		\
+			WARN_ON(1);			\
+	};						\
 	unlikely(__ret_warn_once);			\
 })
-
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