[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] x86/numa: add per-node lock profile objects



Add some basic infrastructure to be able to use lockprofile with per NUMA
node locks.  This patch just introduces the required types, plus the
printing of the data for the newly introduced type.  There's no user of
per NUMA node locks introduced here.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 tools/misc/xenlockprof.c    | 5 +++++
 xen/common/spinlock.c       | 1 +
 xen/include/public/sysctl.h | 3 ++-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/misc/xenlockprof.c b/tools/misc/xenlockprof.c
index 11f43a35e3c0..3fc91e832ae5 100644
--- a/tools/misc/xenlockprof.c
+++ b/tools/misc/xenlockprof.c
@@ -96,6 +96,11 @@ int main(int argc, char *argv[])
         case LOCKPROF_TYPE_PERDOM:
             sprintf(name, "domain %d lock %s", data[j].idx, data[j].name);
             break;
+
+        case LOCKPROF_TYPE_PERNODE:
+            sprintf(name, "NUMA node %d lock %s", data[j].idx, data[j].name);
+            break;
+
         default:
             sprintf(name, "unknown type(%d) %d lock %s", data[j].type,
                     data[j].idx, data[j].name);
diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 38caa10a2ea2..d86e32bd67aa 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -612,6 +612,7 @@ static s_time_t lock_profile_start;
 static struct lock_profile_anc lock_profile_ancs[] = {
     [LOCKPROF_TYPE_GLOBAL] = { .name = "Global" },
     [LOCKPROF_TYPE_PERDOM] = { .name = "Domain" },
+    [LOCKPROF_TYPE_PERNODE] = { .name = "NUMA node" },
 };
 static struct lock_profile_qhead lock_profile_glb_q;
 static spinlock_t lock_profile_lock = SPIN_LOCK_UNLOCKED;
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 9eca72865b87..bcf3dd3b1f31 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -582,7 +582,8 @@ struct xen_sysctl_page_offline_op {
 /* Record-type: */
 #define LOCKPROF_TYPE_GLOBAL      0   /* global lock, idx meaningless */
 #define LOCKPROF_TYPE_PERDOM      1   /* per-domain lock, idx is domid */
-#define LOCKPROF_TYPE_N           2   /* number of types */
+#define LOCKPROF_TYPE_PERNODE     2   /* pNUMA per-node lock, idx is node ID */
+#define LOCKPROF_TYPE_N           3   /* number of types */
 struct xen_sysctl_lockprof_data {
     char     name[40];     /* lock name (may include up to 2 %d specifiers) */
     int32_t  type;         /* LOCKPROF_TYPE_??? */
-- 
2.49.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.