public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RT] fix delay in do_vgettimeofday() in arch/x86_64/kernel/vsyscall.c
@ 2005-12-09 19:38 Serge Belyshev
  2005-12-10  2:33 ` john stultz
  0 siblings, 1 reply; 3+ messages in thread
From: Serge Belyshev @ 2005-12-09 19:38 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linux Kernel Mailing List



There are occasional very very long (30..60 sec) delays happening when calling
gettimeofday() vsyscall on x86_64 with 2.6.14-rt22 kernel.

These delays come from while() looping over invalid data that are
going to be discarded by seqlock.



 arch/x86_64/kernel/vsyscall.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

Index: linux/arch/x86_64/kernel/vsyscall.c
===================================================================
--- linux.orig/arch/x86_64/kernel/vsyscall.c
+++ linux/arch/x86_64/kernel/vsyscall.c
@@ -111,14 +111,15 @@ static force_inline void do_vgettimeofda
 
 		/* add nsec offset to wall_time_tv */
 		*tv = __vsyscall_gtod_data.wall_time_tv;
-		do_div(nsec_delta, NSEC_PER_USEC);
-		tv->tv_usec += (unsigned long) nsec_delta;
-
-		while (tv->tv_usec > USEC_PER_SEC) {
-			tv->tv_sec += 1;
-			tv->tv_usec -= USEC_PER_SEC;
-		}
 	} while (read_seqretry(&__vsyscall_gtod_lock, seq));
+
+	do_div(nsec_delta, NSEC_PER_USEC);
+	tv->tv_usec += (unsigned long) nsec_delta;
+
+	while (tv->tv_usec > USEC_PER_SEC) {
+		tv->tv_sec += 1;
+		tv->tv_usec -= USEC_PER_SEC;
+	}
 }
 
 /*

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

* Re: [RT] fix delay in do_vgettimeofday() in arch/x86_64/kernel/vsyscall.c
  2005-12-09 19:38 [RT] fix delay in do_vgettimeofday() in arch/x86_64/kernel/vsyscall.c Serge Belyshev
@ 2005-12-10  2:33 ` john stultz
  2005-12-10 20:56   ` Fernando Lopez-Lezcano
  0 siblings, 1 reply; 3+ messages in thread
From: john stultz @ 2005-12-10  2:33 UTC (permalink / raw)
  To: Serge Belyshev; +Cc: Ingo Molnar, Linux Kernel Mailing List

On Fri, 2005-12-09 at 22:38 +0300, Serge Belyshev wrote:
> 
> There are occasional very very long (30..60 sec) delays happening when calling
> gettimeofday() vsyscall on x86_64 with 2.6.14-rt22 kernel.
> 
> These delays come from while() looping over invalid data that are
> going to be discarded by seqlock.

Ah, good catch! I just included a similar change (moved all the math
outside the lock) in my own tree.

Thanks for finding this!
-john


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

* Re: [RT] fix delay in do_vgettimeofday() in arch/x86_64/kernel/vsyscall.c
  2005-12-10  2:33 ` john stultz
@ 2005-12-10 20:56   ` Fernando Lopez-Lezcano
  0 siblings, 0 replies; 3+ messages in thread
From: Fernando Lopez-Lezcano @ 2005-12-10 20:56 UTC (permalink / raw)
  To: john stultz; +Cc: nando, Serge Belyshev, Ingo Molnar, Linux Kernel Mailing List

On Fri, 2005-12-09 at 18:33 -0800, john stultz wrote:
> On Fri, 2005-12-09 at 22:38 +0300, Serge Belyshev wrote:
> > 
> > There are occasional very very long (30..60 sec) delays happening when calling
> > gettimeofday() vsyscall on x86_64 with 2.6.14-rt22 kernel.
> > 
> > These delays come from while() looping over invalid data that are
> > going to be discarded by seqlock.
> 
> Ah, good catch! I just included a similar change (moved all the math
> outside the lock) in my own tree.

Is there something equivalent on i386 or this is just an x86_64 thing?
Over the past few days I have seen temporary "lockups" of my machine
(athlon X2 running -2.6.14-rt22, PREEMPT_RT, no hi res timers) lasting
for, say between 10 and 30 seconds. This happens maybe one to three
times in a day (that I noticed). The symptom is that the mouse moves but
everything else is just not doing anything. I don't see anything in the
logs or dmesg after the freeze, or on the servers that machine depends
on (through nfs). During one of those lockups a system load monitor in
the gnome panel was visible and it looked like there was a 100% system
load (or close) in one of the cpus. 

-- Fernando



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

end of thread, other threads:[~2005-12-10 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-09 19:38 [RT] fix delay in do_vgettimeofday() in arch/x86_64/kernel/vsyscall.c Serge Belyshev
2005-12-10  2:33 ` john stultz
2005-12-10 20:56   ` Fernando Lopez-Lezcano

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