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

[Xen-changelog] [xen-unstable] [XEN] Make multicall info explicitly PER_CPU.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 5fc926b5860901cac5dd4b3084e8a23e0c366066
# Parent  ce619ad2d13994006779df1a18c625f6daf23ecd
[XEN] Make multicall info explicitly PER_CPU.
Also remove cacheline alignment in a few places. We leave
the common timer and schedule_data structures aligned because
they may be accessed randomly by remoted CPUs: at least we can
contain cacheline bouncing to just the offending structures.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/ia64/xen/hypercall.c |    2 +-
 xen/arch/x86/domain.c         |    2 +-
 xen/arch/x86/time.c           |    2 +-
 xen/common/multicall.c        |    4 ++--
 xen/include/xen/multicall.h   |    5 +++--
 5 files changed, 8 insertions(+), 7 deletions(-)

diff -r ce619ad2d139 -r 5fc926b58609 xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c     Tue Aug 08 14:29:16 2006 +0100
+++ b/xen/arch/ia64/xen/hypercall.c     Tue Aug 08 14:48:43 2006 +0100
@@ -335,7 +335,7 @@ unsigned long hypercall_create_continuat
 unsigned long hypercall_create_continuation(
        unsigned int op, const char *format, ...)
 {
-    struct mc_state *mcs = &mc_state[smp_processor_id()];
+    struct mc_state *mcs = &this_cpu(mc_state);
     struct vcpu *v = current;
     const char *p = format;
     unsigned long arg;
diff -r ce619ad2d139 -r 5fc926b58609 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Tue Aug 08 14:29:16 2006 +0100
+++ b/xen/arch/x86/domain.c     Tue Aug 08 14:48:43 2006 +0100
@@ -797,7 +797,7 @@ unsigned long hypercall_create_continuat
 unsigned long hypercall_create_continuation(
     unsigned int op, const char *format, ...)
 {
-    struct mc_state *mcs = &mc_state[smp_processor_id()];
+    struct mc_state *mcs = &this_cpu(mc_state);
     struct cpu_user_regs *regs;
     const char *p = format;
     unsigned long arg;
diff -r ce619ad2d139 -r 5fc926b58609 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Tue Aug 08 14:29:16 2006 +0100
+++ b/xen/arch/x86/time.c       Tue Aug 08 14:48:43 2006 +0100
@@ -56,7 +56,7 @@ struct cpu_time {
     s_time_t stime_master_stamp;
     struct time_scale tsc_scale;
     struct timer calibration_timer;
-} __cacheline_aligned;
+};
 
 static DEFINE_PER_CPU(struct cpu_time, cpu_time);
 
diff -r ce619ad2d139 -r 5fc926b58609 xen/common/multicall.c
--- a/xen/common/multicall.c    Tue Aug 08 14:29:16 2006 +0100
+++ b/xen/common/multicall.c    Tue Aug 08 14:48:43 2006 +0100
@@ -14,13 +14,13 @@
 #include <asm/current.h>
 #include <asm/hardirq.h>
 
-struct mc_state mc_state[NR_CPUS];
+DEFINE_PER_CPU(struct mc_state, mc_state);
 
 long
 do_multicall(
     XEN_GUEST_HANDLE(multicall_entry_t) call_list, unsigned int nr_calls)
 {
-    struct mc_state *mcs = &mc_state[smp_processor_id()];
+    struct mc_state *mcs = &this_cpu(mc_state);
     unsigned int     i;
 
     if ( unlikely(__test_and_set_bit(_MCSF_in_multicall, &mcs->flags)) )
diff -r ce619ad2d139 -r 5fc926b58609 xen/include/xen/multicall.h
--- a/xen/include/xen/multicall.h       Tue Aug 08 14:29:16 2006 +0100
+++ b/xen/include/xen/multicall.h       Tue Aug 08 14:48:43 2006 +0100
@@ -5,6 +5,7 @@
 #ifndef __XEN_MULTICALL_H__
 #define __XEN_MULTICALL_H__
 
+#include <xen/percpu.h>
 #include <asm/multicall.h>
 
 #define _MCSF_in_multicall   0
@@ -14,8 +15,8 @@ struct mc_state {
 struct mc_state {
     unsigned long flags;
     struct multicall_entry call;
-} __cacheline_aligned;
+};
 
-extern struct mc_state mc_state[NR_CPUS];
+DECLARE_PER_CPU(struct mc_state, mc_state);
 
 #endif /* __XEN_MULTICALL_H__ */

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


 


Rackspace

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