From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752510AbcFILRt (ORCPT ); Thu, 9 Jun 2016 07:17:49 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34008 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752464AbcFILRo (ORCPT ); Thu, 9 Jun 2016 07:17:44 -0400 Subject: Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags To: Minfei Huang , bp@suse.de, luto@kernel.org, hpa@zytor.com, mingo@redhat.com, tglx@linutronix.de References: <1464329832-4638-3-git-send-email-mnghuan@gmail.com> <1464438463-8485-1-git-send-email-mnghuan@gmail.com> <20160607131621.GA15012@MinfeideMacBook-Pro.local> Cc: x86@kernel.org, linux-kernel@vger.kernel.org From: Paolo Bonzini Message-ID: <3ae047f4-a42e-9f14-dd4c-12df452b7c56@redhat.com> Date: Thu, 9 Jun 2016 13:17:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160607131621.GA15012@MinfeideMacBook-Pro.local> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/06/2016 15:16, Minfei Huang wrote: > ping. Any comment is appreciate. The patch looks good, I'll follow up with another to introduce the seqcount-like read_begin/read_retry API. Thanks, Paolo > On 05/28/16 at 08:27P, Minfei Huang wrote: >> There is a generic function __pvclock_read_cycles to be used to get both >> flags and cycles. For function pvclock_read_flags, it's useless to get >> cycles value. To make this function be more effective, get this variable >> flags directly in function. >> >> Signed-off-by: Minfei Huang >> --- >> v1: >> - Get rid of __pvclock_read_cycles according to Andy's suggestion >> --- >> arch/x86/kernel/pvclock.c | 7 +++++-- >> 1 file changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c >> index 7f82fe0..06c58ce 100644 >> --- a/arch/x86/kernel/pvclock.c >> +++ b/arch/x86/kernel/pvclock.c >> @@ -61,11 +61,14 @@ void pvclock_resume(void) >> u8 pvclock_read_flags(struct pvclock_vcpu_time_info *src) >> { >> unsigned version; >> - cycle_t ret; >> u8 flags; >> >> do { >> - version = __pvclock_read_cycles(src, &ret, &flags); >> + version = src->version; >> + /* Make the latest version visible */ >> + smp_rmb(); >> + >> + flags = src->flags; >> /* Make sure that the version double-check is last. */ >> smp_rmb(); >> } while ((src->version & 1) || version != src->version); >> -- >> 2.6.3 >> >