From: Andrew Morton Cc: Andi Kleen Cc: Daniel Walker Cc: Hua Zhong Cc: Valdis.Kletnieks@vt.edu Signed-off-by: Andrew Morton --- arch/x86/kernel/vsyscall_64.c | 11 ++--------- arch/x86/vdso/vclock_gettime.c | 11 ++--------- include/linux/compiler.h | 3 ++- 3 files changed, 6 insertions(+), 19 deletions(-) diff -puN arch/x86/kernel/vsyscall_64.c~profile-likely-unlikely-macros-fix arch/x86/kernel/vsyscall_64.c --- a/arch/x86/kernel/vsyscall_64.c~profile-likely-unlikely-macros-fix +++ a/arch/x86/kernel/vsyscall_64.c @@ -17,6 +17,8 @@ * want per guest time just set the kernel.vsyscall64 sysctl to 0. */ +#define SUPPRESS_LIKELY_PROFILING + #include #include #include @@ -46,15 +48,6 @@ #define __syscall_clobber "r11","cx","memory" /* - * likely and unlikely explode when used in vdso in combination with - * profile-likely-unlikely-macros.patch - */ -#undef likely -#define likely(x) (x) -#undef unlikely -#define unlikely(x) (x) - -/* * vsyscall_gtod_data contains data that is : * - readonly from vsyscalls * - written by timer interrupt or systcl (/proc/sys/kernel/vsyscall64) diff -puN arch/x86/vdso/vclock_gettime.c~profile-likely-unlikely-macros-fix arch/x86/vdso/vclock_gettime.c --- a/arch/x86/vdso/vclock_gettime.c~profile-likely-unlikely-macros-fix +++ a/arch/x86/vdso/vclock_gettime.c @@ -9,6 +9,8 @@ * Also alternative() doesn't work. */ +#define SUPPRESS_LIKELY_PROFILING + #include #include #include @@ -23,15 +25,6 @@ #define gtod vdso_vsyscall_gtod_data -/* - * likely and unlikely explode when used in vdso in combination with - * profile-likely-unlikely-macros.patch - */ -#undef likely -#define likely(x) (x) -#undef unlikely -#define unlikely(x) (x) - static long vdso_fallback_gettime(long clock, struct timespec *ts) { long ret; diff -puN include/linux/compiler.h~profile-likely-unlikely-macros-fix include/linux/compiler.h --- a/include/linux/compiler.h~profile-likely-unlikely-macros-fix +++ a/include/linux/compiler.h @@ -51,7 +51,8 @@ extern void __chk_io_ptr(const volatile # include #endif -#if defined(CONFIG_PROFILE_LIKELY) && !(defined(CONFIG_MODULE_UNLOAD) && defined(MODULE)) +#if defined(CONFIG_PROFILE_LIKELY) && !defined(SUPPRESS_LIKELY_PROFILING) && \ + !(defined(CONFIG_MODULE_UNLOAD) && defined(MODULE)) struct likeliness { const char *func; char *file; _