xen-devel
RE: [Xen-devel] [PATCH] X86: Prefer TSC-deadline timer in Xen
To: |
Jan Beulich <JBeulich@xxxxxxxxxx> |
Subject: |
RE: [Xen-devel] [PATCH] X86: Prefer TSC-deadline timer in Xen |
From: |
"Wei, Gang" <gang.wei@xxxxxxxxx> |
Date: |
Thu, 28 Oct 2010 23:05:22 +0800 |
Accept-language: |
zh-CN, en-US |
Acceptlanguage: |
zh-CN, en-US |
Cc: |
"Brown, Len" <len.brown@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, "Wei, Gang" <gang.wei@xxxxxxxxx> |
Delivery-date: |
Thu, 28 Oct 2010 08:08:03 -0700 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxxx |
In-reply-to: |
<4CC9A679020000780001FC4F@xxxxxxxxxxxxxxxxxx> |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<F26D193E20BBDC42A43B611D1BDEDE71218A98966A@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4CC94671020000780001FA65@xxxxxxxxxxxxxxxxxx> <F26D193E20BBDC42A43B611D1BDEDE71218A98983A@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4CC97DDF020000780001FBCA@xxxxxxxxxxxxxxxxxx> <F26D193E20BBDC42A43B611D1BDEDE71218A98988A@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <F26D193E20BBDC42A43B611D1BDEDE71218A989893@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4CC9A679020000780001FC4F@xxxxxxxxxxxxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
Thread-index: |
Act2rWMzQdNCTypfTYmEunzrkNWnYQAA+N3A |
Thread-topic: |
[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
|
|
|