xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Haozhong Zhang" <haozhong.zhang@intel.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Joao Martins <joao.m.martins@oracle.com>,
	Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH RFC 0/6] x86/time: PVCLOCK_TSC_STABLE_BIT support
Date: Wed, 30 Dec 2015 11:47:52 +0800	[thread overview]
Message-ID: <20151230034752.GE16809@hz-desktop.sh.intel.com> (raw)
In-Reply-To: <56829FAB.1060008@citrix.com>

On 12/29/15 14:58, Andrew Cooper wrote:
> On 28/12/2015 16:59, Joao Martins wrote:
> >Hey!
> >
> >I've been working on pvclock vdso support on Linux guests, and came
> >across Xen lacking support for PVCLOCK_TSC_STABLE_BIT flag which is
> >required for vdso as of the latest pvclock ABI shared with KVM.
> 
> , and originally borrowed from Xen.
> 
> Please be aware that all of this was originally the Xen ABI (c/s 1271b793,
> 2005) and was added to Linux (c/s 7af192c, 2008) for join use with KVM.  In
> particular, Linux c/s 424c32f1a (which introduces 'flags') and every
> subsequent change in pvclock-abi.h violates the comment at the top,
> reminding people that the hypervisors must be kept in sync.
> 
> By the looks of things, the structures are still compatible, and having the
> two in sync is in everyones best interest. The first steps here need to be
> Linux upstreaming their local modifications, and further efforts made to
> ensuring that ABI changes don't go unnoticed as far as Xen is concerned
> (entry in the maintainers file with xen-devel listed?)
> 
> >In addition, I've found some problems which aren't necessarily visible
> >to kernel as the pvclock algorithm in linux keeps the highest pvti
> >time read among all cpus. But as is, a process using vdso gettimeofday
> >observes a significant amount of warps (i.e. time going backwards) and
> >it could be due to 1) time calibration skew in xen rendezvous
> >algorithm, 2) xen clocksource not in sync with TSC and 3) in
> >situations when guests unaware of VCPUS moving to a different PCPU.
> >The warps are seen more frequently on PV guests (potentially because
> >vcpu time infos are only updated when guest is in kernel mode, and
> >perhaps lack of tsc_offset?), and in rare ocasions on HVM guests. And
> >it is worth noting that with guests VCPUs pinned, only PV guests see
> >these warps. But on HVM guests specifically: such warps only occur
> >when one of guest VCPUs is pinned to CPU0.
> 
> These are all concerning findings (especially the pinning on cpu0). Which
> version of Xen have you been developing on?
> 
> Haozhong Zhang (CC'd) found and fixed several timing related bugs as part of
> his VMX TSC Scaling support series (Message root at
> <1449435529-12989-1-git-send-email-haozhong.zhang@intel.com>). I would be
> surprised if your identified bugs and his identified bugs didn't at least
> partially overlap.  (Note that most of the series has yet to be applied).
> 

My VMX TSC scaling support patch series takes more concern on bugs
that can cause problems when TSC scaling is used for HVM guests. I
didn't test much for PV guests and HVM guests with pinned vcpu, so I
think Joao's patch series is fixing different timing bugs.

Haozhong

      parent reply	other threads:[~2015-12-30  3:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-28 16:59 [PATCH RFC 0/6] x86/time: PVCLOCK_TSC_STABLE_BIT support Joao Martins
2015-12-28 16:59 ` [PATCH RFC 1/6] public/xen.h: add flags field to vcpu_time_info Joao Martins
2016-01-25 20:11   ` Konrad Rzeszutek Wilk
2016-01-26 10:31     ` Joao Martins
2015-12-28 16:59 ` [PATCH RFC 2/6] x86/time: implement tsc as clocksource Joao Martins
2015-12-29 15:11   ` Andrew Cooper
2015-12-29 17:37     ` Joao Martins
2015-12-28 16:59 ` [PATCH RFC 3/6] x86/time: streamline platform time init on plt_init() Joao Martins
2016-01-25 20:26   ` Konrad Rzeszutek Wilk
2016-01-26 10:31     ` Joao Martins
2015-12-28 16:59 ` [PATCH RFC 4/6] x86/time: refactor read_platform_stime() Joao Martins
2015-12-28 16:59 ` [PATCH RFC 5/6] x86/time: implement PVCLOCK_TSC_STABLE_BIT Joao Martins
2015-12-28 16:59 ` [PATCH RFC 6/6] x86/time: convert counter to tsc for non-tsc clocksource Joao Martins
2015-12-29 14:58 ` [PATCH RFC 0/6] x86/time: PVCLOCK_TSC_STABLE_BIT support Andrew Cooper
2015-12-29 17:37   ` Joao Martins
2016-02-22 21:14     ` Joao Martins
2016-02-23  8:09       ` Jan Beulich
2016-02-23 12:13         ` Joao Martins
2015-12-30  3:47   ` Haozhong Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151230034752.GE16809@hz-desktop.sh.intel.com \
    --to=haozhong.zhang@intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=joao.m.martins@oracle.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).