public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [git pull] scheduler warning fix
@ 2008-11-09  7:19 Ingo Molnar
  2008-11-09 19:23 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2008-11-09  7:19 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kernel, Andrew Morton, Peter Zijlstra, Mike Galbraith

Linus,

Please pull the latest sched-fixes-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git sched-fixes-for-linus

Fixes a silly build warning that slipped through yesterday, sorry 
about that.

 Thanks,

	Ingo

------------------>
Ingo Molnar (1):
      x86: clean up vget_cycles()


 arch/x86/include/asm/tsc.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h
index 9cd83a8..8ee029b 100644
--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -34,8 +34,6 @@ static inline cycles_t get_cycles(void)
 
 static __always_inline cycles_t vget_cycles(void)
 {
-	cycles_t cycles;
-
 	/*
 	 * We only do VDSOs on TSC capable CPUs, so this shouldnt
 	 * access boot_cpu_data (which is not VDSO-safe):

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [git pull] scheduler warning fix
  2008-11-09  7:19 [git pull] scheduler warning fix Ingo Molnar
@ 2008-11-09 19:23 ` Linus Torvalds
  2008-11-09 20:02   ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2008-11-09 19:23 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Andrew Morton, Peter Zijlstra, Mike Galbraith



On Sun, 9 Nov 2008, Ingo Molnar wrote:
> 
> Please pull the latest sched-fixes-for-linus git tree from:
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git sched-fixes-for-linus
> 
> Fixes a silly build warning that slipped through yesterday, sorry 
> about that.

Whaa?

  In file included from /home/torvalds/v2.6/linux/arch/x86/include/asm/timex.h:6,
                   from include/linux/timex.h:202,
                   from include/linux/jiffies.h:8,
                   from include/linux/ktime.h:25,
                   from include/linux/timer.h:5,
                   from include/linux/workqueue.h:8,
                   from include/linux/slub_def.h:11,
                   from include/linux/slab.h:124,
                   from include/linux/percpu.h:5,
                   from include/linux/rcupdate.h:39,
                   from include/linux/tracepoint.h:18,
                   from include/linux/module.h:19,
                   from include/linux/crypto.h:21,
                   from arch/x86/kernel/asm-offsets_64.c:7,
                   from arch/x86/kernel/asm-offsets.c:4:
  /home/torvalds/v2.6/linux/arch/x86/include/asm/tsc.h: In function ‘vget_cycles’:
  /home/torvalds/v2.6/linux/arch/x86/include/asm/tsc.h:46: error: ‘cycles’ undeclared (first use in this function)
  /home/torvalds/v2.6/linux/arch/x86/include/asm/tsc.h:46: error: (Each undeclared identifier is reported only once
  /home/torvalds/v2.6/linux/arch/x86/include/asm/tsc.h:46: error: for each function it appears in.)
  make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1
  make: *** [prepare0] Error 2

That makes no sense. You've apparently done some idiotic rebasing of a 
patch that needs to be applied on top of an earlier patch into a tree that 
does _not_ need it, and then send it as a pull request.

What _are_ you doing?

			Linus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [git pull] scheduler warning fix
  2008-11-09 19:23 ` Linus Torvalds
@ 2008-11-09 20:02   ` Ingo Molnar
  0 siblings, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2008-11-09 20:02 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kernel, Andrew Morton, Peter Zijlstra, Mike Galbraith


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> On Sun, 9 Nov 2008, Ingo Molnar wrote:
> > 
> > Please pull the latest sched-fixes-for-linus git tree from:
> > 
> >    git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git sched-fixes-for-linus
> > 
> > Fixes a silly build warning that slipped through yesterday, sorry 
> > about that.
> 
> Whaa?
> 
>   In file included from /home/torvalds/v2.6/linux/arch/x86/include/asm/timex.h:6,
>                    from include/linux/timex.h:202,
>                    from include/linux/jiffies.h:8,
>                    from include/linux/ktime.h:25,
>                    from include/linux/timer.h:5,
>                    from include/linux/workqueue.h:8,
>                    from include/linux/slub_def.h:11,
>                    from include/linux/slab.h:124,
>                    from include/linux/percpu.h:5,
>                    from include/linux/rcupdate.h:39,
>                    from include/linux/tracepoint.h:18,
>                    from include/linux/module.h:19,
>                    from include/linux/crypto.h:21,
>                    from arch/x86/kernel/asm-offsets_64.c:7,
>                    from arch/x86/kernel/asm-offsets.c:4:
>   /home/torvalds/v2.6/linux/arch/x86/include/asm/tsc.h: In function ‘vget_cycles’:
>   /home/torvalds/v2.6/linux/arch/x86/include/asm/tsc.h:46: error: ‘cycles’ undeclared (first use in this function)
>   /home/torvalds/v2.6/linux/arch/x86/include/asm/tsc.h:46: error: (Each undeclared identifier is reported only once
>   /home/torvalds/v2.6/linux/arch/x86/include/asm/tsc.h:46: error: for each function it appears in.)
>   make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1
>   make: *** [prepare0] Error 2
> 
> That makes no sense. You've apparently done some idiotic rebasing of 
> a patch that needs to be applied on top of an earlier patch into a 
> tree that does _not_ need it, and then send it as a pull request.
>
> What _are_ you doing?

Sigh, sorry - please disregard the pull request.

What happened is that the cleanup patch below introduced that warning 
- and this morning i noticed that warning and i thought i introduced 
an ugly warning upstream and did a quick fix in that branch - but it 
didnt actually need any fixing (and in fact it broke the build).

So upstream is fine and doesnt need any fix.

	Ingo

------------------------>
>From cb9e35dce94a1b9c59d46224e8a94377d673e204 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Sat, 8 Nov 2008 20:27:00 +0100
Subject: [PATCH] x86: clean up rdtsc_barrier() use

Impact: cleanup

Move rdtsc_barrier() use to vsyscall_64.c where it's relied on,
and point out its role in the context of its use.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/include/asm/tsc.h    |    6 +-----
 arch/x86/kernel/vsyscall_64.c |    9 +++++++++
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h
index 9cd83a8..700aeb8 100644
--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -44,11 +44,7 @@ static __always_inline cycles_t vget_cycles(void)
 	if (!cpu_has_tsc)
 		return 0;
 #endif
-	rdtsc_barrier();
-	cycles = (cycles_t)__native_read_tsc();
-	rdtsc_barrier();
-
-	return cycles;
+	return (cycles_t)__native_read_tsc();
 }
 
 extern void tsc_init(void);
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 0b8b669..ebf2f12 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -128,7 +128,16 @@ static __always_inline void do_vgettimeofday(struct timeval * tv)
 			gettimeofday(tv,NULL);
 			return;
 		}
+
+		/*
+		 * Surround the RDTSC by barriers, to make sure it's not
+		 * speculated to outside the seqlock critical section and
+		 * does not cause time warps:
+		 */
+		rdtsc_barrier();
 		now = vread();
+		rdtsc_barrier();
+
 		base = __vsyscall_gtod_data.clock.cycle_last;
 		mask = __vsyscall_gtod_data.clock.mask;
 		mult = __vsyscall_gtod_data.clock.mult;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-09 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-09  7:19 [git pull] scheduler warning fix Ingo Molnar
2008-11-09 19:23 ` Linus Torvalds
2008-11-09 20:02   ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox