[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.