All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Ian Jackson <Ian.Jackson@citrix.com>,
	"Keir (Xen.org)" <keir@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2 3/3] x86/viridian: Add partition time reference counter MSR support
Date: Mon, 4 Aug 2014 14:12:03 +0000	[thread overview]
Message-ID: <9AAE0902D5BC7E449B7C8E4E778ABCD03FFAEF@AMSPEX01CL01.citrite.net> (raw)
In-Reply-To: <53DFAE4802000078000290F1@mail.emea.novell.com>

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 04 August 2014 15:01
> To: Paul Durrant
> Cc: Ian Campbell; Ian Jackson; Stefano Stabellini; xen-devel@lists.xen.org;
> Keir (Xen.org)
> Subject: Re: [PATCH v2 3/3] x86/viridian: Add partition time reference
> counter MSR support
> 
> >>> On 04.08.14 at 15:12, <paul.durrant@citrix.com> wrote:
> > +static s_time_t get_time_ref_count(struct domain *d)
> > +{
> > +    s_time_t now = get_s_time() / 100;
> > +    struct viridian_time_ref_count *trc;
> > +
> > +    trc = &d->arch.hvm_domain.viridian.time_ref_count;
> > +
> > +    spin_lock(&trc->lock);
> 
> How well do you think this will scale, taking into consideration our
> recent observations with certain Windows versions having all its
> CPUs race for time stamps over apparently extended periods of
> time? It would seem to me that a cmpxchg() based approach
> might be preferable here.

Yes, that may well be true.

> 
> > +
> > +    if ( trc->last == 0 )
> > +        gdprintk(XENLOG_G_INFO, "TIME_REFERENCE_COUNTER
> accessed\n");
> 
> As per the comments on patch 2, this needs to be either printk() or
> the _G_ in the middle converted to just _.
> 

Ok.

> > +
> > +    if ( (now - trc->last) > 0 )
> > +        trc->last = now;
> > +    else
> > +        now = ++trc->last;
> 
> And how well is that going to work (and match Windows'
> expectations) when the migration destination host's NOW() is
> significantly smaller than the source host's?
> 

I misunderstood what get_s_time() is returning so I think you're correct that this will not work will in that case. It's basically the same as the PV rdtsc code; but maybe that won't work either.

  Paul

> > @@ -344,6 +383,14 @@ int rdmsr_viridian_regs(uint32_t idx, uint64_t *val)
> >          *val = v->arch.hvm_vcpu.viridian.apic_assist.raw;
> >          break;
> >
> > +    case VIRIDIAN_MSR_TIME_REF_COUNT:
> > +        if ( !(viridian_feature_mask(d) & HVMPV_time_ref_count) )
> > +            return 0;
> > +
> > +        perfc_incr(mshv_rdmsr_time_ref_count);
> > +        *val = (uint64_t)get_time_ref_count(d);
> 
> Pointless cast.
> 
> Jan

  reply	other threads:[~2014-08-04 14:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 13:12 [PATCH v2 0/3] x86/viridian improvements Paul Durrant
2014-08-04 13:12 ` [PATCH v2 1/3] x86/viridian: Re-purpose the HVM parameter to be a feature mask Paul Durrant
2014-08-04 13:31   ` Andrew Cooper
2014-08-04 13:50     ` Jan Beulich
2014-08-04 14:50       ` Andrew Cooper
2014-08-04 15:13         ` Jan Beulich
2014-08-04 17:19     ` Paul Durrant
2014-08-04 13:45   ` Jan Beulich
2014-08-04 13:12 ` [PATCH v2 2/3] x86/viridian: Note that logging is under control of the guest Paul Durrant
2014-08-04 13:38   ` Andrew Cooper
2014-08-04 13:45     ` Paul Durrant
2014-08-04 13:12 ` [PATCH v2 3/3] x86/viridian: Add partition time reference counter MSR support Paul Durrant
2014-08-04 14:01   ` Jan Beulich
2014-08-04 14:12     ` Paul Durrant [this message]
2014-08-04 14:47       ` Paul Durrant
2014-08-04 15:11         ` Paul Durrant
2014-08-04 15:15           ` Jan Beulich
2014-08-04 15:23             ` Paul Durrant

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=9AAE0902D5BC7E449B7C8E4E778ABCD03FFAEF@AMSPEX01CL01.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Stefano.Stabellini@citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.