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

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;

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

                        adjust_watchdog -= NS_PER_TICK;


Xen-devel mailing list



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