[PATCH] sparse: makes dom0 boot on SMP

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] sparse: makes dom0 boot on SMP

Ryan Grimm
Hi,

recently, i have been unable to boot dom0 with SMP on an x86 and x86_64
box with the latest changeset.  today, i was able to boot dom0 reliably by
unapplying the patch from changeset 7275 to 7276 (that is included as the
first attachment as a reference).

starting with a fresh pull, i am able to boot dom0 by making NS_PER_TICK a
signed long long instead of unsigned long long (patch included as second
attachment).

i assume the original motivation of changing NS_PER_TICK to a 64-bit value
was for the jiffies_to_st function, since it includes a multiply, delta
* NS_PER_TICK.

The only other function NS_PER_TICK seems to appear in is
timer_interrupt().  i do not know why the original change from
signed to unsigned would cause dom0 to fail on my smp machines.  perhaps someone
with more knowledge of time.c can shed some light?

thanks,
ryan
_______________________________________________
Xen-devel mailing list
[hidden email]
http://lists.xensource.com/xen-devel

7276.patch (2K) Download Attachment
smp_fix.patch (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] sparse: makes dom0 boot on SMP

Keir Fraser

On 13 Oct 2005, at 00:13, Ryan Grimm wrote:

> i assume the original motivation of changing NS_PER_TICK to a 64-bit
> value was for the jiffies_to_st function, since it includes a
> multiply, delta * NS_PER_TICK.
>
> The only other function NS_PER_TICK seems to appear in is
> timer_interrupt().  i do not know why the original change from signed
> to unsigned would cause dom0 to fail on my smp machines.  perhaps
> someone with more knowledge of time.c can shed some light?

Yes, that change is definitely broken. It can cause the kernel to spin
in the following loops if delta is ever -ve (because s64 gets promoted
to u64 by std C rules, -ve becomes *big* +ve):
   while ( delta > NS_PER_TICK )
     .....

I'll change it back -- the main thing was to make 'delta' a 64-bit
quantity in jiffies_to_st(), which is independent of whether
NS_PER_TICK is signed or not.

  -- Keir


_______________________________________________
Xen-devel mailing list
[hidden email]
http://lists.xensource.com/xen-devel