ia64/xen-unstable

changeset 11011:5fc926b58609

[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@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Aug 08 14:48:43 2006 +0100 (2006-08-08)
parents ce619ad2d139
children aa25666d4643
files xen/arch/ia64/xen/hypercall.c xen/arch/x86/domain.c xen/arch/x86/time.c xen/common/multicall.c xen/include/xen/multicall.h
line diff
     1.1 --- a/xen/arch/ia64/xen/hypercall.c	Tue Aug 08 14:29:16 2006 +0100
     1.2 +++ b/xen/arch/ia64/xen/hypercall.c	Tue Aug 08 14:48:43 2006 +0100
     1.3 @@ -335,7 +335,7 @@ ia64_hypercall (struct pt_regs *regs)
     1.4  unsigned long hypercall_create_continuation(
     1.5  	unsigned int op, const char *format, ...)
     1.6  {
     1.7 -    struct mc_state *mcs = &mc_state[smp_processor_id()];
     1.8 +    struct mc_state *mcs = &this_cpu(mc_state);
     1.9      struct vcpu *v = current;
    1.10      const char *p = format;
    1.11      unsigned long arg;
     2.1 --- a/xen/arch/x86/domain.c	Tue Aug 08 14:29:16 2006 +0100
     2.2 +++ b/xen/arch/x86/domain.c	Tue Aug 08 14:48:43 2006 +0100
     2.3 @@ -797,7 +797,7 @@ void sync_vcpu_execstate(struct vcpu *v)
     2.4  unsigned long hypercall_create_continuation(
     2.5      unsigned int op, const char *format, ...)
     2.6  {
     2.7 -    struct mc_state *mcs = &mc_state[smp_processor_id()];
     2.8 +    struct mc_state *mcs = &this_cpu(mc_state);
     2.9      struct cpu_user_regs *regs;
    2.10      const char *p = format;
    2.11      unsigned long arg;
     3.1 --- a/xen/arch/x86/time.c	Tue Aug 08 14:29:16 2006 +0100
     3.2 +++ b/xen/arch/x86/time.c	Tue Aug 08 14:48:43 2006 +0100
     3.3 @@ -56,7 +56,7 @@ struct cpu_time {
     3.4      s_time_t stime_master_stamp;
     3.5      struct time_scale tsc_scale;
     3.6      struct timer calibration_timer;
     3.7 -} __cacheline_aligned;
     3.8 +};
     3.9  
    3.10  static DEFINE_PER_CPU(struct cpu_time, cpu_time);
    3.11  
     4.1 --- a/xen/common/multicall.c	Tue Aug 08 14:29:16 2006 +0100
     4.2 +++ b/xen/common/multicall.c	Tue Aug 08 14:48:43 2006 +0100
     4.3 @@ -14,13 +14,13 @@
     4.4  #include <asm/current.h>
     4.5  #include <asm/hardirq.h>
     4.6  
     4.7 -struct mc_state mc_state[NR_CPUS];
     4.8 +DEFINE_PER_CPU(struct mc_state, mc_state);
     4.9  
    4.10  long
    4.11  do_multicall(
    4.12      XEN_GUEST_HANDLE(multicall_entry_t) call_list, unsigned int nr_calls)
    4.13  {
    4.14 -    struct mc_state *mcs = &mc_state[smp_processor_id()];
    4.15 +    struct mc_state *mcs = &this_cpu(mc_state);
    4.16      unsigned int     i;
    4.17  
    4.18      if ( unlikely(__test_and_set_bit(_MCSF_in_multicall, &mcs->flags)) )
     5.1 --- a/xen/include/xen/multicall.h	Tue Aug 08 14:29:16 2006 +0100
     5.2 +++ b/xen/include/xen/multicall.h	Tue Aug 08 14:48:43 2006 +0100
     5.3 @@ -5,6 +5,7 @@
     5.4  #ifndef __XEN_MULTICALL_H__
     5.5  #define __XEN_MULTICALL_H__
     5.6  
     5.7 +#include <xen/percpu.h>
     5.8  #include <asm/multicall.h>
     5.9  
    5.10  #define _MCSF_in_multicall   0
    5.11 @@ -14,8 +15,8 @@
    5.12  struct mc_state {
    5.13      unsigned long flags;
    5.14      struct multicall_entry call;
    5.15 -} __cacheline_aligned;
    5.16 +};
    5.17  
    5.18 -extern struct mc_state mc_state[NR_CPUS];
    5.19 +DECLARE_PER_CPU(struct mc_state, mc_state);
    5.20  
    5.21  #endif /* __XEN_MULTICALL_H__ */