mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Waiman Long <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: akpm@linux-foundation.org, scott.norton@hpe.com,
	Waiman.Long@hpe.com, paulmck@linux.vnet.ibm.com, hpa@zytor.com,
	tglx@linutronix.de, mingo@kernel.org,
	linux-kernel@vger.kernel.org, doug.hatch@hpe.com,
	torvalds@linux-foundation.org, peterz@infradead.org
Subject: [tip:locking/core] locking/pvqspinlock: Enable slowpath locking count tracking
Date: Mon, 29 Feb 2016 03:21:23 -0800	[thread overview]
Message-ID: <tip-32d62510f949d3c8e83b9b3b844a84446611661b@git.kernel.org> (raw)
In-Reply-To: <1449778666-13593-2-git-send-email-Waiman.Long@hpe.com>

Commit-ID:  32d62510f949d3c8e83b9b3b844a84446611661b
Gitweb:     http://git.kernel.org/tip/32d62510f949d3c8e83b9b3b844a84446611661b
Author:     Waiman Long <Waiman.Long@hpe.com>
AuthorDate: Thu, 10 Dec 2015 15:17:45 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 29 Feb 2016 10:02:42 +0100

locking/pvqspinlock: Enable slowpath locking count tracking

This patch enables the tracking of the number of slowpath locking
operations performed. This can be used to compare against the number
of lock stealing operations to see what percentage of locks are stolen
versus acquired via the regular slowpath.

Signed-off-by: Waiman Long <Waiman.Long@hpe.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Douglas Hatch <doug.hatch@hpe.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Scott J Norton <scott.norton@hpe.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1449778666-13593-2-git-send-email-Waiman.Long@hpe.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/locking/qspinlock_paravirt.h | 5 +++++
 kernel/locking/qspinlock_stat.h     | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_paravirt.h
index 78f04a2..21ede57 100644
--- a/kernel/locking/qspinlock_paravirt.h
+++ b/kernel/locking/qspinlock_paravirt.h
@@ -400,6 +400,11 @@ pv_wait_head_or_lock(struct qspinlock *lock, struct mcs_spinlock *node)
 	if (READ_ONCE(pn->state) == vcpu_hashed)
 		lp = (struct qspinlock **)1;
 
+	/*
+	 * Tracking # of slowpath locking operations
+	 */
+	qstat_inc(qstat_pv_lock_slowpath, true);
+
 	for (;; waitcnt++) {
 		/*
 		 * Set correct vCPU state to be used by queue node wait-early
diff --git a/kernel/locking/qspinlock_stat.h b/kernel/locking/qspinlock_stat.h
index 869988d..eb2a2c9 100644
--- a/kernel/locking/qspinlock_stat.h
+++ b/kernel/locking/qspinlock_stat.h
@@ -22,6 +22,7 @@
  *   pv_kick_wake	- # of vCPU kicks used for computing pv_latency_wake
  *   pv_latency_kick	- average latency (ns) of vCPU kick operation
  *   pv_latency_wake	- average latency (ns) from vCPU kick to wakeup
+ *   pv_lock_slowpath	- # of locking operations via the slowpath
  *   pv_lock_stealing	- # of lock stealing operations
  *   pv_spurious_wakeup	- # of spurious wakeups
  *   pv_wait_again	- # of vCPU wait's that happened after a vCPU kick
@@ -45,6 +46,7 @@ enum qlock_stats {
 	qstat_pv_kick_wake,
 	qstat_pv_latency_kick,
 	qstat_pv_latency_wake,
+	qstat_pv_lock_slowpath,
 	qstat_pv_lock_stealing,
 	qstat_pv_spurious_wakeup,
 	qstat_pv_wait_again,
@@ -70,6 +72,7 @@ static const char * const qstat_names[qstat_num + 1] = {
 	[qstat_pv_spurious_wakeup] = "pv_spurious_wakeup",
 	[qstat_pv_latency_kick]	   = "pv_latency_kick",
 	[qstat_pv_latency_wake]    = "pv_latency_wake",
+	[qstat_pv_lock_slowpath]   = "pv_lock_slowpath",
 	[qstat_pv_lock_stealing]   = "pv_lock_stealing",
 	[qstat_pv_wait_again]      = "pv_wait_again",
 	[qstat_pv_wait_early]      = "pv_wait_early",

  reply	other threads:[~2016-02-29 11:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 20:17 [PATCH tip/locking/core 1/3] locking/qspinlock: Use smp_cond_acquire() in pending code Waiman Long
2015-12-10 20:17 ` [PATCH tip/locking/core 2/3] locking/pvqspinlock: Enable slowpath locking count tracking Waiman Long
2016-02-29 11:21   ` tip-bot for Waiman Long [this message]
2015-12-10 20:17 ` [PATCH tip/locking/core 3/3] locking/pvqspinlock: Direct lock stealing count tracking in pv_queued_spin_steal_lock Waiman Long
2016-02-29 11:20   ` [tip:locking/core] locking/pvqspinlock: Move lock stealing count tracking code into pv_queued_spin_steal_lock() tip-bot for Waiman Long
2016-02-29 11:20 ` [tip:locking/core] locking/qspinlock: Use smp_cond_acquire() in pending code tip-bot for 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=tip-32d62510f949d3c8e83b9b3b844a84446611661b@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=Waiman.Long@hpe.com \
    --cc=akpm@linux-foundation.org \
    --cc=doug.hatch@hpe.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=scott.norton@hpe.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®