WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] trace: Do not touch percpu data for "impo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] trace: Do not touch percpu data for "impossible" cpus.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 May 2010 05:15:35 -0700
Delivery-date: Wed, 19 May 2010 05:17:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1273858742 -3600
# Node ID 44f25f7250bea0f14d90f4174f7cd337bc6215bf
# Parent  e95448fc993ed011bae65296a3f531798b128518
trace: Do not touch percpu data for "impossible" cpus.

While here, in fact only touch per-cpu data for online cpus. Use cpu
notifier chain to initialise per-cpu spinlock dynamically.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/common/trace.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff -r e95448fc993e -r 44f25f7250be xen/common/trace.c
--- a/xen/common/trace.c        Fri May 14 18:25:55 2010 +0100
+++ b/xen/common/trace.c        Fri May 14 18:39:02 2010 +0100
@@ -29,6 +29,7 @@
 #include <xen/init.h>
 #include <xen/mm.h>
 #include <xen/percpu.h>
+#include <xen/cpu.h>
 #include <asm/atomic.h>
 #include <public/sysctl.h>
 
@@ -214,8 +215,6 @@ static int tb_set_size(int size)
      */
     int ret = 0;
 
-
-
     if ( (opt_tbuf_size != 0) )
     {
         if ( size != opt_tbuf_size )
@@ -269,6 +268,20 @@ int trace_will_trace_event(u32 event)
     return 1;
 }
 
+static int cpu_callback(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+
+    if ( action == CPU_UP_PREPARE )
+        spin_lock_init(&per_cpu(t_lock, cpu));
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback
+};
 /**
  * init_trace_bufs - performs initialization of the per-cpu trace buffers.
  *
@@ -289,8 +302,9 @@ void __init init_trace_bufs(void)
         return;
     }
 
-    for(i = 0; i < NR_CPUS; i++)
+    for_each_online_cpu ( i )
         spin_lock_init(&per_cpu(t_lock, i));
+    register_cpu_notifier(&cpu_nfb);
 
     for(i=0; i<T_INFO_PAGES; i++)
         share_xen_page_with_privileged_guests(

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] trace: Do not touch percpu data for "impossible" cpus., Xen patchbot-unstable <=