public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Waiman Long <longman@redhat.com>
Cc: linux-arch@vger.kernel.org, "Juergen Gross" <jgross@suse.com>,
	"Jeremy Fitzhardinge" <jeremy@goop.org>,
	x86@kernel.org, kvm@vger.kernel.org,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Pan Xinhui" <xinhui.pan@linux.vnet.ibm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	"Chris Wright" <chrisw@sous-sol.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	"Alok Kataria" <akataria@vmware.com>,
	"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH 1/2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function
Date: Wed, 8 Feb 2017 20:05:08 +0100	[thread overview]
Message-ID: <20170208190508.GA6515@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1486576825-17058-1-git-send-email-longman@redhat.com>

On Wed, Feb 08, 2017 at 01:00:24PM -0500, Waiman Long wrote:
> It was found when running fio sequential write test with a XFS ramdisk
> on a 2-socket x86-64 system, the %CPU times as reported by perf were
> as follows:
> 
>  71.27%  0.28%  fio  [k] down_write
>  70.99%  0.01%  fio  [k] call_rwsem_down_write_failed
>  69.43%  1.18%  fio  [k] rwsem_down_write_failed
>  65.51% 54.57%  fio  [k] osq_lock
>   9.72%  7.99%  fio  [k] __raw_callee_save___kvm_vcpu_is_preempted
>   4.16%  4.16%  fio  [k] __kvm_vcpu_is_preempted
> 
> So making vcpu_is_preempted() a callee-save function has a pretty high
> cost associated with it. As vcpu_is_preempted() is called within the
> spinlock, mutex and rwsem slowpaths, there isn't much to gain by making
> it callee-save. So it is now changed to a normal function call instead.
> 

Numbers for bare metal too please.

WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: Waiman Long <longman@redhat.com>
Cc: "Jeremy Fitzhardinge" <jeremy@goop.org>,
	"Chris Wright" <chrisw@sous-sol.org>,
	"Alok Kataria" <akataria@vmware.com>,
	"Rusty Russell" <rusty@rustcorp.com.au>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-arch@vger.kernel.org, x86@kernel.org,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	xen-devel@lists.xenproject.org, kvm@vger.kernel.org,
	"Pan Xinhui" <xinhui.pan@linux.vnet.ibm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Juergen Gross" <jgross@suse.com>
Subject: Re: [PATCH 1/2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function
Date: Wed, 8 Feb 2017 20:05:08 +0100	[thread overview]
Message-ID: <20170208190508.GA6515@twins.programming.kicks-ass.net> (raw)
Message-ID: <20170208190508.f73VbfhMChnsBuep6J5irSAG4U-j-u9bcZC8Yhvsxpk@z> (raw)
In-Reply-To: <1486576825-17058-1-git-send-email-longman@redhat.com>

On Wed, Feb 08, 2017 at 01:00:24PM -0500, Waiman Long wrote:
> It was found when running fio sequential write test with a XFS ramdisk
> on a 2-socket x86-64 system, the %CPU times as reported by perf were
> as follows:
> 
>  71.27%  0.28%  fio  [k] down_write
>  70.99%  0.01%  fio  [k] call_rwsem_down_write_failed
>  69.43%  1.18%  fio  [k] rwsem_down_write_failed
>  65.51% 54.57%  fio  [k] osq_lock
>   9.72%  7.99%  fio  [k] __raw_callee_save___kvm_vcpu_is_preempted
>   4.16%  4.16%  fio  [k] __kvm_vcpu_is_preempted
> 
> So making vcpu_is_preempted() a callee-save function has a pretty high
> cost associated with it. As vcpu_is_preempted() is called within the
> spinlock, mutex and rwsem slowpaths, there isn't much to gain by making
> it callee-save. So it is now changed to a normal function call instead.
> 

Numbers for bare metal too please.

  parent reply	other threads:[~2017-02-08 19:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 18:00 [PATCH 1/2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function Waiman Long
2017-02-08 18:00 ` Waiman Long
2017-02-08 18:00 ` [PATCH 2/2] locking/mutex, rwsem: Reduce vcpu_is_preempted() calling frequency Waiman Long
2017-02-08 18:00   ` [PATCH 2/2] locking/mutex,rwsem: " Waiman Long
2017-02-08 19:05   ` Peter Zijlstra
2017-02-08 19:05     ` Peter Zijlstra
2017-02-08 19:09     ` Waiman Long
2017-02-08 19:09       ` Waiman Long
2017-02-08 19:05 ` Peter Zijlstra [this message]
2017-02-08 19:05   ` [PATCH 1/2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function Peter Zijlstra
2017-02-08 20:17   ` Waiman Long
2017-02-08 20:17     ` Waiman Long

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=20170208190508.GA6515@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akataria@vmware.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=chrisw@sous-sol.org \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=jgross@suse.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xinhui.pan@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox