Re: [PATCH 2/3] kvm: use this_cpu_xxx replace percpu_xxx funcs

2012-01-11 Thread Alex,Shi
> > > 
> > > Acked-by: Avi Kivity 
> > > 
> >
> > And this one, picking up or comments are all appreciated. :) 
> 
> Just to be clear, you want this applied in kvm.git?
> 

Thanks Avi! 
I saw it is in your 3.3 submit list. 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] kvm: use this_cpu_xxx replace percpu_xxx funcs

2011-11-21 Thread Alex,Shi
> > > > > percpu_xxx funcs are duplicated with this_cpu_xxx funcs, so replace 
> > > > > them
> > > > > for further code clean up.
> > > > > 
> > > > > And in preempt safe scenario, __this_cpu_xxx funcs has a bit better
> > > > > performance since __this_cpu_xxx has no redundant preempt_disable()
> > > > > 
> > > >
> > > > Avi: 
> > > > Would you like to give some comments of this? 
> > > >
> > > 
> > > Sorry, was travelling:
> > > 
> > > Acked-by: Avi Kivity 
> > > 
> >
> > And this one, picking up or comments are all appreciated. :) 
> 
> Just to be clear, you want this applied in kvm.git?
> 


Glad to be there! :) 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] kvm: use this_cpu_xxx replace percpu_xxx funcs

2011-11-21 Thread Avi Kivity
On 11/21/2011 11:02 AM, Alex,Shi wrote:
> On Mon, 2011-10-24 at 19:05 +0800, Avi Kivity wrote:
> > On 10/24/2011 04:50 AM, Alex,Shi wrote:
> > > On Thu, 2011-10-20 at 15:34 +0800, Alex,Shi wrote:
> > > > percpu_xxx funcs are duplicated with this_cpu_xxx funcs, so replace them
> > > > for further code clean up.
> > > > 
> > > > And in preempt safe scenario, __this_cpu_xxx funcs has a bit better
> > > > performance since __this_cpu_xxx has no redundant preempt_disable()
> > > > 
> > >
> > > Avi: 
> > > Would you like to give some comments of this? 
> > >
> > 
> > Sorry, was travelling:
> > 
> > Acked-by: Avi Kivity 
> > 
>
> And this one, picking up or comments are all appreciated. :) 

Just to be clear, you want this applied in kvm.git?

-- 
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] kvm: use this_cpu_xxx replace percpu_xxx funcs

2011-11-21 Thread Alex,Shi
On Mon, 2011-10-24 at 19:05 +0800, Avi Kivity wrote:
> On 10/24/2011 04:50 AM, Alex,Shi wrote:
> > On Thu, 2011-10-20 at 15:34 +0800, Alex,Shi wrote:
> > > percpu_xxx funcs are duplicated with this_cpu_xxx funcs, so replace them
> > > for further code clean up.
> > > 
> > > And in preempt safe scenario, __this_cpu_xxx funcs has a bit better
> > > performance since __this_cpu_xxx has no redundant preempt_disable()
> > > 
> >
> > Avi: 
> > Would you like to give some comments of this? 
> >
> 
> Sorry, was travelling:
> 
> Acked-by: Avi Kivity 
> 

And this one, picking up or comments are all appreciated. :) 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] kvm: use this_cpu_xxx replace percpu_xxx funcs

2011-10-24 Thread Avi Kivity
On 10/24/2011 04:50 AM, Alex,Shi wrote:
> On Thu, 2011-10-20 at 15:34 +0800, Alex,Shi wrote:
> > percpu_xxx funcs are duplicated with this_cpu_xxx funcs, so replace them
> > for further code clean up.
> > 
> > And in preempt safe scenario, __this_cpu_xxx funcs has a bit better
> > performance since __this_cpu_xxx has no redundant preempt_disable()
> > 
>
> Avi: 
> Would you like to give some comments of this? 
>

Sorry, was travelling:

Acked-by: Avi Kivity 

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] kvm: use this_cpu_xxx replace percpu_xxx funcs

2011-10-23 Thread Alex,Shi
On Thu, 2011-10-20 at 15:34 +0800, Alex,Shi wrote:
> percpu_xxx funcs are duplicated with this_cpu_xxx funcs, so replace them
> for further code clean up.
> 
> And in preempt safe scenario, __this_cpu_xxx funcs has a bit better
> performance since __this_cpu_xxx has no redundant preempt_disable()
> 

Avi: 
Would you like to give some comments of this? 

> Signed-off-by: Alex Shi 
> ---
>  arch/x86/kvm/x86.c |   14 +++---
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 84a28ea..432c4bc 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -5024,15 +5024,15 @@ static DEFINE_PER_CPU(struct kvm_vcpu *, 
> current_vcpu);
>  
>  static int kvm_is_in_guest(void)
>  {
> - return percpu_read(current_vcpu) != NULL;
> + return __this_cpu_read(current_vcpu) != NULL;
>  }
>  
>  static int kvm_is_user_mode(void)
>  {
>   int user_mode = 3;
>  
> - if (percpu_read(current_vcpu))
> - user_mode = kvm_x86_ops->get_cpl(percpu_read(current_vcpu));
> + if (__this_cpu_read(current_vcpu))
> + user_mode = kvm_x86_ops->get_cpl(__this_cpu_read(current_vcpu));
>  
>   return user_mode != 0;
>  }
> @@ -5041,8 +5041,8 @@ static unsigned long kvm_get_guest_ip(void)
>  {
>   unsigned long ip = 0;
>  
> - if (percpu_read(current_vcpu))
> - ip = kvm_rip_read(percpu_read(current_vcpu));
> + if (__this_cpu_read(current_vcpu))
> + ip = kvm_rip_read(__this_cpu_read(current_vcpu));
>  
>   return ip;
>  }
> @@ -5055,13 +5055,13 @@ static struct perf_guest_info_callbacks kvm_guest_cbs 
> = {
>  
>  void kvm_before_handle_nmi(struct kvm_vcpu *vcpu)
>  {
> - percpu_write(current_vcpu, vcpu);
> + __this_cpu_write(current_vcpu, vcpu);
>  }
>  EXPORT_SYMBOL_GPL(kvm_before_handle_nmi);
>  
>  void kvm_after_handle_nmi(struct kvm_vcpu *vcpu)
>  {
> - percpu_write(current_vcpu, NULL);
> + __this_cpu_write(current_vcpu, NULL);
>  }
>  EXPORT_SYMBOL_GPL(kvm_after_handle_nmi);
>  


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html