All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Glauber de Oliveira Costa <glommer@gmail.com>
Cc: Avi Kivity <avi@qumranet.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kvm-devel <kvm-devel@lists.sourceforge.net>
Subject: Use of barriers in pvclock ABI
Date: Fri, 08 Aug 2008 12:51:54 -0700	[thread overview]
Message-ID: <489CA3DA.1090400@goop.org> (raw)

In Xen, we guarantee that the pv clock record will only ever be updated 
by the current cpu, so there will never be any cross-cpu barrier or 
synchronization issues to consider, nor any chance a vcpu will see its 
own clock record in a partially updated state.

I notice the current kvm implementation is the same.

However, the pvclock_clocksource_read() implementation is 
over-engineered, because it checks for an odd version and uses very 
strong rmb() barriers (which generates either an "lfence" or "lock add 
$0, (%esp)").

If we're happy to guarantee as an ABI issue that the record will never 
be updated cross-cpu, then we can make the barriers simply barrier() and 
just check for (src->version != dst->version).

Is that OK with you, or do you want to leave open the possibility of 
doing cross-cpu time updates?

    J

             reply	other threads:[~2008-08-08 19:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08 19:51 Jeremy Fitzhardinge [this message]
2008-08-11  7:08 ` Use of barriers in pvclock ABI Gerd Hoffmann
2008-08-11 14:15   ` Avi Kivity
2008-08-11 14:18   ` Glauber Costa
2008-08-11 14:35     ` Avi Kivity
2008-08-11 14:49     ` Gerd Hoffmann
2008-08-11 16:02     ` Jeremy Fitzhardinge

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=489CA3DA.1090400@goop.org \
    --to=jeremy@goop.org \
    --cc=avi@qumranet.com \
    --cc=glommer@gmail.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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.