- fix-gcc-3x-w-likely-profiling.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     Fix gcc 3.x w/ likely profiling

has been removed from the -mm tree.  Its filename is

     fix-gcc-3x-w-likely-profiling.patch

This patch was probably dropped from -mm because
it has now been merged into a subsystem tree or
into Linus's tree, or because it was folded into
its parent patch in the -mm tree.

------------------------------------------------------
Subject: Fix gcc 3.x w/ likely profiling
From: Daniel Walker <dwalker@xxxxxxxxxx>


I used gcc 4.x when testing , so it must not effect those compilers.  I
managed to find a compiler that exibited this.  It appears the compiler
blows up while trying to evaluate constants .  The patch below is suppose
to give the compiler an easy way out.  Instead of processing our code it
just processes the constant ..  This will also prevent the profiling of
these constant values, since that's not very interesting anyway ..

I tested on ,

pentium4-gcc (GCC) 3.4.3 (MontaVista 3.4.3-25.0.36.0501258 2005-08-14)

Which was the only compiler I could find that had this issue ..
The patch resolved it, and the profiling still worked.

Signed-off-by: Daniel Walker <dwalker@xxxxxxxxxx>
Cc: Hua Zhong <hzhong@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 include/linux/compiler.h |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff -puN include/linux/compiler.h~fix-gcc-3x-w-likely-profiling include/linux/compiler.h
--- 25/include/linux/compiler.h~fix-gcc-3x-w-likely-profiling	Thu Apr 27 16:17:52 2006
+++ 25-akpm/include/linux/compiler.h	Thu Apr 27 16:17:52 2006
@@ -78,8 +78,14 @@ extern int do_check_likely(struct likeli
 		do_check_likely(&likeliness, !!(exp));			\
 	})
 
-#define likely(x)	__check_likely((x), 1)
-#define unlikely(x)	__check_likely((x), 0)
+/*
+ * We check for constant values with __builtin_constant_p() since
+ * it's not interesting to profile them, and there is a compiler
+ * bug in gcc 3.x which blows up during constant evalution when
+ * CONFIG_PROFILE_LIKELY is turned on.
+ */
+#define likely(x)	(__builtin_constant_p(x) ? (!!(x)) : __check_likely((x), 1))
+#define unlikely(x)	(__builtin_constant_p(x) ? (!!(x)) : __check_likely((x), 0))
 #else
 /*
  * Generic compiler-dependent macros required for kernel
_

Patches currently in -mm which might be from dwalker@xxxxxxxxxx are

megaraid-gcc-41-warning-fix.patch
buslogic-gcc-41-warning-fixes.patch
invert-irq-migrationc-brach-prediction.patch
idetape-gcc-41-warning-fix.patch
profile-likely-unlikely-macros.patch
fix-gcc-3x-w-likely-profiling.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux