From: Andrew Morton <akpm@linux-foundation.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: Valdis.Kletnieks@vt.edu, linux-kernel@vger.kernel.org
Subject: Re: 2.6.25-rc3-mm1 - PROFILE_LIKELY redux..
Date: Wed, 5 Mar 2008 10:02:21 -0800 [thread overview]
Message-ID: <20080305100221.1d7316e6.akpm@linux-foundation.org> (raw)
In-Reply-To: <p738x0x5al2.fsf@bingen.suse.de>
On Wed, 05 Mar 2008 18:45:13 +0100 Andi Kleen <andi@firstfloor.org> wrote:
> Valdis.Kletnieks@vt.edu writes:
> >
> > So we're in the same 4K as the VDSO64_* values, but some 0x4fe past the
> > gtod_data. Anybody got a hint as to what the heck it was doing?
>
> Try this patch:
>
> Remove unlikelies in vsyscall path
>
> Remove unlikely in vsyscall path that conflict with unlikely profiling.
> The unlikelies shouldn't be needed anyways because gcc predicts
> condition leading to early return as unlikely by default and
> for the loops it shouldn't make much difference
>
> --- linux.orig/arch/x86/kernel/vsyscall_64.c
> +++ linux/arch/x86/kernel/vsyscall_64.c
> ...
> --- linux.orig/arch/x86/vdso/vclock_gettime.c
> +++ linux/arch/x86/vdso/vclock_gettime.c
Yes, but both those files now have:
/*
* 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)
at the top, so it'll be something else. Perhaps a `likely' snuck in via an
inline in a header file. It would be better to add a #define DONT_DO_THAT
at the top of arch/x86/kernel/vsyscall_64.c and
arch/x86/vdso/vclock_gettime.c, then use that to defeat likely-profiling.
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 <linux/time.h>
#include <linux/init.h>
#include <linux/kernel.h>
@@ -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 <linux/kernel.h>
#include <linux/posix-timers.h>
#include <linux/time.h>
@@ -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 <linux/compiler-intel.h>
#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;
_
next prev parent reply other threads:[~2008-03-05 18:03 UTC|newest]
Thread overview: 126+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-04 9:19 2.6.25-rc3-mm1 Andrew Morton
2008-03-04 11:59 ` 2.6.25-rc3-mm1 Cornelia Huck
2008-03-04 19:35 ` 2.6.25-rc3-mm1 Greg KH
2008-03-04 13:12 ` [BUG] 2.6.25-rc3-mm1 kernel panic while bootup on powerpc () Kamalesh Babulal
2008-03-04 13:12 ` Kamalesh Babulal
2008-03-04 14:40 ` Michael Neuling
2008-03-04 14:40 ` Michael Neuling
2008-03-04 18:33 ` Andrew Morton
2008-03-04 18:33 ` Andrew Morton
2008-03-05 8:23 ` Benjamin Herrenschmidt
2008-03-05 8:23 ` Benjamin Herrenschmidt
2008-03-06 0:03 ` Benjamin Herrenschmidt
2008-03-06 0:03 ` Benjamin Herrenschmidt
2008-03-06 0:44 ` Andrew Morton
2008-03-06 0:44 ` Andrew Morton
2008-03-06 0:52 ` Benjamin Herrenschmidt
2008-03-06 0:52 ` Benjamin Herrenschmidt
2008-03-04 18:36 ` Andrew Morton
2008-03-04 18:36 ` Andrew Morton
2008-03-04 18:36 ` Andrew Morton
2008-03-04 18:47 ` Pekka Enberg
2008-03-04 18:47 ` Pekka Enberg
2008-03-04 18:47 ` Pekka Enberg
2008-03-04 19:18 ` Pekka Enberg
2008-03-04 19:18 ` Pekka Enberg
2008-03-04 19:18 ` Pekka Enberg
2008-03-04 19:35 ` Mel Gorman
2008-03-04 19:35 ` Mel Gorman
2008-03-04 19:41 ` Pekka Enberg
2008-03-04 19:41 ` Pekka Enberg
2008-03-04 19:56 ` Christoph Lameter
2008-03-04 19:56 ` Christoph Lameter
2008-03-04 20:01 ` Pekka J Enberg
2008-03-04 20:01 ` Pekka J Enberg
2008-03-04 20:02 ` Christoph Lameter
2008-03-04 20:02 ` Christoph Lameter
2008-03-04 20:07 ` Christoph Lameter
2008-03-04 20:07 ` Christoph Lameter
2008-03-04 20:08 ` Pekka Enberg
2008-03-04 20:08 ` Pekka Enberg
2008-03-05 2:28 ` Kamalesh Babulal
2008-03-05 2:28 ` Kamalesh Babulal
2008-03-04 20:34 ` Andrew Morton
2008-03-04 20:34 ` Andrew Morton
2008-03-04 20:44 ` Pekka Enberg
2008-03-04 20:44 ` Pekka Enberg
2008-03-04 21:44 ` Christoph Lameter
2008-03-04 21:44 ` Christoph Lameter
2008-03-05 14:02 ` Mel Gorman
2008-03-05 14:02 ` Mel Gorman
2008-03-05 14:31 ` Mel Gorman
2008-03-05 14:31 ` Mel Gorman
2008-03-04 20:01 ` Christoph Lameter
2008-03-04 20:01 ` Christoph Lameter
2008-03-05 8:22 ` Benjamin Herrenschmidt
2008-03-05 8:22 ` Benjamin Herrenschmidt
2008-03-04 16:35 ` 2.6.25-rc3-mm1 (IDE) Randy Dunlap
2008-03-06 21:14 ` Bartlomiej Zolnierkiewicz
2008-03-04 16:45 ` 2.6.25-rc3-mm1 (CCISS) Randy Dunlap
2008-03-04 17:02 ` Miller, Mike (OS Dev)
2008-03-04 17:14 ` Randy Dunlap
2008-03-04 18:14 ` Jens Axboe
2008-03-04 19:12 ` [PATCH 2.6.25-rc3-mm1] fix ext2 borkage Hugh Dickins
2008-03-04 19:20 ` [BUG] 2.6.25-rc3-mm1 kernel bug while running libhugetlbfs Kamalesh Babulal
2008-03-04 19:20 ` Kamalesh Babulal
2008-03-04 19:51 ` Andrew Morton
2008-03-04 19:51 ` Andrew Morton
2008-03-04 22:01 ` Adam Litke
2008-03-04 22:01 ` Adam Litke
2008-03-05 7:52 ` Kamalesh Babulal
2008-03-05 7:52 ` Kamalesh Babulal
2008-03-04 20:24 ` 2.6.25-rc3-mm1 (wakeup) Randy Dunlap
2008-03-04 22:33 ` Rafael J. Wysocki
2008-03-05 7:40 ` Sam Ravnborg
2008-03-04 21:26 ` 2.6.25-rc3-mm1 (9p docs) Randy Dunlap
2008-03-04 21:43 ` Eric Van Hensbergen
2008-03-05 7:21 ` 2.6.25-rc3-mm1 - PROFILE_LIKELY redux Valdis.Kletnieks
2008-03-05 17:45 ` Andi Kleen
2008-03-05 18:02 ` Andrew Morton [this message]
2008-03-05 18:22 ` Andi Kleen
2008-03-05 22:26 ` Valdis.Kletnieks
2008-03-05 23:49 ` Andrew Morton
2008-03-05 19:59 ` Valdis.Kletnieks
2008-03-05 21:56 ` Andi Kleen
2008-03-05 10:51 ` prctl(0x8) -> EINVAL [Was: 2.6.25-rc3-mm1] Jiri Slaby
2008-03-05 10:59 ` Jiri Slaby
2008-03-05 14:06 ` Serge E. Hallyn
2008-03-05 15:18 ` Jiri Slaby
2008-03-09 16:28 ` Andrew Morgan
2008-03-05 13:04 ` 2.6.25-rc3-mm1 Pavel Emelyanov
2008-03-05 13:12 ` 2.6.25-rc3-mm1 (SYSFS=n breaks module engine) Pavel Emelyanov
2008-03-05 13:31 ` 2.6.25-rc3-mm1 Kay Sievers
2008-03-05 13:38 ` 2.6.25-rc3-mm1 Pavel Emelyanov
2008-03-05 13:54 ` 2.6.25-rc3-mm1 Kay Sievers
2008-03-05 14:28 ` 2.6.25-rc3-mm1 Pavel Emelyanov
2008-03-05 16:40 ` 2.6.25-rc3-mm1 Greg KH
2008-03-05 16:59 ` 2.6.25-rc3-mm1 Pavel Emelyanov
2008-03-05 17:07 ` 2.6.25-rc3-mm1 Greg KH
2008-03-05 21:34 ` 2.6.25-rc3-mm1 ppc64 boot hang Badari Pulavarty
2008-03-05 21:34 ` Badari Pulavarty
2008-03-05 21:54 ` Andrew Morton
2008-03-05 21:54 ` Andrew Morton
2008-03-05 22:35 ` Badari Pulavarty
2008-03-05 22:35 ` Badari Pulavarty
2008-03-05 23:17 ` Stephen Rothwell
2008-03-05 23:17 ` Stephen Rothwell
2008-03-07 3:58 ` 2.6.25-rc3-mm1 - BUG at system shutdown time Valdis.Kletnieks
2008-03-07 6:16 ` Andrew Morton
2008-03-07 7:52 ` Valdis.Kletnieks
2008-03-07 8:06 ` Thomas Gleixner
2008-03-07 8:23 ` Valdis.Kletnieks
2008-03-07 8:34 ` Thomas Gleixner
2008-03-07 19:30 ` Valdis.Kletnieks
2008-03-12 7:32 ` Andrew Morton
2008-03-13 2:19 ` Valdis.Kletnieks
2008-03-13 2:32 ` Andrew Morton
2008-03-13 3:57 ` Valdis.Kletnieks
2008-03-13 4:27 ` Andrew Morton
2008-03-14 18:50 ` Valdis.Kletnieks
2008-03-21 13:41 ` Ingo Molnar
2008-03-21 19:38 ` Valdis.Kletnieks
2008-03-21 19:58 ` Ingo Molnar
2008-03-21 20:05 ` Valdis.Kletnieks
2008-03-21 20:12 ` Ingo Molnar
2008-03-22 3:11 ` Hoo-fscking-ray - (was " Valdis.Kletnieks
2008-03-22 12:09 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080305100221.1d7316e6.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Valdis.Kletnieks@vt.edu \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.