linux-um archives
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: Nix <nix@esperi.org.uk>
Cc: Thomas Gleixner <tglx@timesys.com>,
	user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] Lockups with the fixed timer code :/
Date: Mon, 14 Apr 2008 10:40:52 -0400	[thread overview]
Message-ID: <20080414144052.GA7186@c2.user-mode-linux.org> (raw)
In-Reply-To: <87k5jcqmh8.fsf@hades.wkstn.nix>

On Sat, Apr 05, 2008 at 05:45:39PM +0100, Nix wrote:
> The fixed timer patch you posted a few weeks back has indeed fixed my
> select()-based timeout woes.
> 
> Unfortunately, both with the old kludgy approach and with the new
> remain-versus-max estimator code, I see intermittent tight lockups of
> the UML kernel-space ptrace thread, with that thread chewing all
> available CPU time and the virtual machine, unsurprisingly, going
> unresponsive. 

Below is another patch for you to try.  I spent most of last week
chasing this one.  The symptoms are somewhat similar to yours -
intermittent UML hangs, although not with UML spinning, and it still
pings.

The problem is NTP adjusting the multiplier part of the clock-provided
cycles-to-ns conversion function.  UML pretended to have a ns clock,
with a multiplier of 1.  When NTP adjusted that down in order to slow
down the clock, that became 0, and time stopped.

The fix below is to switch to a usec clock, with a multiplier of 1000,
which can be adjusted with much more granualarity.

      	     	      Jeff

-- 
Work email - jdike at linux dot intel dot com

Index: linux-2.6.22/arch/um/kernel/time.c
===================================================================
--- linux-2.6.22.orig/arch/um/kernel/time.c	2008-04-10 12:53:32.000000000 -0400
+++ linux-2.6.22/arch/um/kernel/time.c	2008-04-14 10:30:00.000000000 -0400
@@ -75,7 +75,7 @@ static irqreturn_t um_timer(int irq, voi
 
 static cycle_t itimer_read(void)
 {
-	return os_nsecs();
+	return os_nsecs() / 1000;
 }
 
 static struct clocksource itimer_clocksource = {
@@ -83,7 +83,7 @@ static struct clocksource itimer_clockso
 	.rating		= 300,
 	.read		= itimer_read,
 	.mask		= CLOCKSOURCE_MASK(64),
-	.mult		= 1,
+	.mult		= 1000,
 	.shift		= 0,
 	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
 };

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2008-04-14 14:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-05 16:45 [uml-devel] Lockups with the fixed timer code :/ Nix
2008-04-14 14:40 ` Jeff Dike [this message]
2008-04-15 19:47   ` Nix
2008-04-15 20:59     ` Ryan Finnie
2008-04-16 19:44     ` Nix
2008-04-24 19:57       ` Nix
2008-04-24 20:37         ` Jeff Dike
2008-04-24 22:18           ` Nix

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=20080414144052.GA7186@c2.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=nix@esperi.org.uk \
    --cc=tglx@timesys.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox