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


Groups > linux.kernel > #1416154 > unrolled thread

Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags

Started byMinfei Huang <mnghuan@gmail.com>
First post2016-06-07 15:20 +0200
Last post2016-06-09 13:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in  function pvclock_read_flags Minfei Huang <mnghuan@gmail.com> - 2016-06-07 15:20 +0200
    Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in  function pvclock_read_flags Paolo Bonzini <pbonzini@redhat.com> - 2016-06-09 13:20 +0200

#1416154 — Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags

FromMinfei Huang <mnghuan@gmail.com>
Date2016-06-07 15:20 +0200
SubjectRe: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags
Message-ID<rHp5f-3b5-5@gated-at.bofh.it>
ping. Any comment is appreciate.

Thanks
Minfei

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 <mnghuan@gmail.com>
> ---
> 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
> 

[toc] | [next] | [standalone]


#1418243

FromPaolo Bonzini <pbonzini@redhat.com>
Date2016-06-09 13:20 +0200
Message-ID<rI6ad-5BC-11@gated-at.bofh.it>
In reply to#1416154

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 <mnghuan@gmail.com>
>> ---
>> 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
>>
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web