Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1578687

RE: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject RE: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method
Date Fri, 10 Feb 2017 19:30:01 +0100
Message-ID <t9o7f-73R-7@gated-at.bofh.it> (permalink)
References <t8XJL-7cN-7@gated-at.bofh.it> <t8XJL-7cN-5@gated-at.bofh.it> <t90oi-rG-7@gated-at.bofh.it> <t91DI-18P-11@gated-at.bofh.it> <t9k3E-4oZ-23@gated-at.bofh.it> <t9k3E-4oZ-21@gated-at.bofh.it> <t9moN-5Rn-11@gated-at.bofh.it>
User-Agent Alpine 2.20 (DEB 67 2015-01-07)
MIME-Version 1.0
Content-Type text/plain; charset=US-ASCII
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 39
Organization linux.* mail to news gateway
X-Original-Cc Vitaly Kuznetsov <vkuznets@redhat.com>, "x86@kernel.org" <x86@kernel.org>, Andy Lutomirski <luto@amacapital.net>, Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>, KY Srinivasan <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>, Dexuan Cui <decui@microsoft.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "devel@linuxdriverproject.org" <devel@linuxdriverproject.org>, "virtualization@lists.linux-foundation.org" <virtualization@lists.linux-foundation.org>
X-Original-Date Fri, 10 Feb 2017 19:01:52 +0100 (CET)
X-Original-Message-ID <alpine.DEB.2.20.1702101852000.4036@nanos>
X-Original-References <20170209141052.18694-1-vkuznets@redhat.com> <20170209141052.18694-3-vkuznets@redhat.com> <alpine.DEB.2.20.1702091806400.3604@nanos> <BLUPR0301MB20986D17696C3E658D511FACCC450@BLUPR0301MB2098.namprd03.prod.outlook.com> <87d1eqqlkv.fsf@vitty.brq.redhat.com> <alpine.DEB.2.20.1702101326520.4036@nanos> <BLUPR0301MB2098E1283D42BD2C3772D839CC440@BLUPR0301MB2098.namprd03.prod.outlook.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1578687

Show key headers only | View raw


On Fri, 10 Feb 2017, Stephen Hemminger wrote:

> Since sequence count algorithm is done by hypervisor, better to not reuse seqcount.
> Still concerned that the code is racy.

That's a different question and can only be answered by the hypervisor
folks. Dunno, whether they have barrier requirements. The seqcount stuff
relies on:

do {
	seq = READ_ONCE(s->sequence);

	smp_rmb();

	sample_data();
  
	smp_rmb();
} while (s->sequence != seq);

which pairs with the writer side:

       s->sequence++;
       
       smp_wmb();

       update_data();

       smp_wmb();

       s->sequence++;

That's important if the stuff happens cross CPU. If the update happens on
the same CPU then this is a different story and as there are VMexits
involved they might provide the required ordering already. But I can't tell
as I have no idea how that host side thing is done.

Thanks,

	tglx

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-02-09 15:20 +0100
  Re: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read  method Thomas Gleixner <tglx@linutronix.de> - 2017-02-09 18:10 +0100
    RE: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method Stephen Hemminger <sthemmin@microsoft.com> - 2017-02-09 19:30 +0100
      Re: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read  method Thomas Gleixner <tglx@linutronix.de> - 2017-02-10 15:10 +0100
        RE: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method Stephen Hemminger <sthemmin@microsoft.com> - 2017-02-10 17:40 +0100
          RE: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read  method Thomas Gleixner <tglx@linutronix.de> - 2017-02-10 19:30 +0100
            RE: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method Dexuan Cui <decui@microsoft.com> - 2017-02-13 09:00 +0100
              RE: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read  method Thomas Gleixner <tglx@linutronix.de> - 2017-02-13 10:30 +0100
      Re: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-02-10 15:50 +0100
    RE: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method KY Srinivasan <kys@microsoft.com> - 2017-02-09 21:50 +0100
      Re: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method Andy Lutomirski <luto@amacapital.net> - 2017-02-10 00:00 +0100
        Re: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method Stephen Hemminger <stephen@networkplumber.org> - 2017-02-10 00:20 +0100
        Re: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-02-10 13:20 +0100
    Re: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-02-10 12:10 +0100
      Re: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read  method Thomas Gleixner <tglx@linutronix.de> - 2017-02-10 12:40 +0100

csiph-web