[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: [Xen-devel] [PATCH] X86: Prefer TSC-deadline timer in Xen
>Jan Beulich [mailto:JBeulich@xxxxxxxxxx], October 28, 2010 10:36 PM > >>> 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. I decided to remove tdt_enable and just keep tdt_enabled. > > >- 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. I will remove it. Jimmy _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |