WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH] Fix softlockup issue after vcpu hotplug

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>, "Tian, Kevin" <kevin.tian@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] Fix softlockup issue after vcpu hotplug
From: "Graham, Simon" <Simon.Graham@xxxxxxxxxxx>
Date: Thu, 1 Feb 2007 18:44:05 -0500
Cc: "Graham, Simon" <Simon.Graham@xxxxxxxxxxx>
Delivery-date: Thu, 01 Feb 2007 15:43:53 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcdESFqDCWsISfq5RGeHgxcxVzRqmQACelaDAAAZiDAAAQnwRAATVWmwABVdeuAAQqkN4AAKff/fAAh92KAAAhEUjgAAKprQ
Thread-topic: [Xen-devel] [PATCH] Fix softlockup issue after vcpu hotplug
 
> The test inside the loop should check against NS_PER_TICK*100, not
just
> 0.
> You only want to override the usual running of the watchdog if you get
> a big
> bunch of time stolen from you. Actually, five seconds
> (NS_PER_TICK*5*HZ)
> would be good: no reason to make the comparison dependent on the
> duration of
> a jiffy.
> 

I thought about this - the problem is I don't know what the current
value of the watchdog is, so if stolen is greater than zero, I need to
do it once immediately and then once every 5s or so in the loop - I cant
just do it the first n times through the loop because then I might do
10s worth of jiffy updates following all the watchdog touches... (BTW -
the test for NS_PER_TICK*100 was just for the purposes of
instrumentation)

So - to move to a scheme where we only touch the watchdog every 5s of
simulated time, I'd need to track if it's been 5s since the last time I
did it... that would mean maintaining another variable to track when the
last time I updated the watchdog was and I thought this would actually
be more overhead than simply updating it everytime round the loop.

I do agree that the test should be against NS_PER_TICK rather than 0 -
I'll make that change.

If you really think it's bad to touch the watchdog on each loop, then
I'd suggest doing this I think:

        int next_wd = 0;

        /* System-wide jiffy work. */
        while (delta >= NS_PER_TICK) {
                delta -= NS_PER_TICK;
                processed_system_time += NS_PER_TICK;
                do_timer(regs);

                if (adjust_watchdog >= NS_PER_TICK) {
                        if (next_wd == 0) {
                                /* Avoid lockup warnings */
                                touch_softlockup_watchdog();
                                next_wd = HZ*5; // Dont adjust again for
another 5s
                        }
                        else
                                next_wd--;

                        adjust_watchdog -= NS_PER_TICK;
                }
        }

Simon

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel