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] X86: Prefer TSC-deadline timer in Xen

>>> On 28.10.10 at 16:17, "Wei, Gang" <gang.wei@xxxxxxxxx> wrote:
> +static int tdt_enabled __read_mostly;
> +static int tdt_enable __read_mostly = 1;

I wasn't completely correct with my earlier statement regarding these:
tdt_enable really should be __initdata, as it's only referenced by an
__init function.

>-    if ( timeout && ((expire = timeout - NOW()) > 0) )
>-        apic_tmict = min_t(u64, (bus_scale * expire) >> 18, UINT_MAX);
>-
>-    apic_write(APIC_TMICT, (unsigned long)apic_tmict);
>+    if ( tdt_enabled )
>+    {
>+        u64 tsc = 0;
>+
>+        if ( timeout )
>+            tsc = stime2tsc(timeout);
>+
>+        wrmsrl(MSR_IA32_TSC_DEADLINE, tsc);
>+
>+        return 1;
>+    }
>+    else
>+    {
>+        if ( timeout && ((expire = timeout - NOW()) > 0) )
>+            apic_tmict = min_t(u64, (bus_scale * expire) >> 18, UINT_MAX);
>+
>+        apic_write(APIC_TMICT, (unsigned long)apic_tmict);
>+    }
> 
>     return apic_tmict || !timeout;

So you still decided to keep the "else"? Without it the patch would be
smaller and, at least to me, the function remain better readable...

But that's minor, or course, patch looks good to me regardless.

Jan


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