ia64/xen-unstable

changeset 17445:d2010614d9f1

Turn some simple softirqs into tasklets.

TRACE_SOFTIRQ does not appear to be necessary at all.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Apr 11 15:55:42 2008 +0100 (2008-04-11)
parents 96b099ad0497
children 9e4c5b7e5aa6
files xen/arch/x86/traps.c xen/common/keyhandler.c xen/common/trace.c xen/include/xen/softirq.h
line diff
     1.1 --- a/xen/arch/x86/traps.c	Fri Apr 11 15:37:48 2008 +0100
     1.2 +++ b/xen/arch/x86/traps.c	Fri Apr 11 15:55:42 2008 +0100
     1.3 @@ -2637,12 +2637,14 @@ asmlinkage void do_general_protection(st
     1.4      panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code);
     1.5  }
     1.6  
     1.7 -static void nmi_softirq(void)
     1.8 +static void nmi_action(unsigned long unused)
     1.9  {
    1.10      /* Only used to defer wakeup of dom0,vcpu0 to a safe (non-NMI) context. */
    1.11      vcpu_kick(dom0->vcpu[0]);
    1.12  }
    1.13  
    1.14 +static DECLARE_TASKLET(nmi_tasklet, nmi_action, 0);
    1.15 +
    1.16  static void nmi_dom0_report(unsigned int reason_idx)
    1.17  {
    1.18      struct domain *d;
    1.19 @@ -2654,7 +2656,7 @@ static void nmi_dom0_report(unsigned int
    1.20      set_bit(reason_idx, nmi_reason(d));
    1.21  
    1.22      if ( !test_and_set_bool(v->nmi_pending) )
    1.23 -        raise_softirq(NMI_SOFTIRQ); /* not safe to wake up a vcpu here */
    1.24 +        tasklet_schedule(&nmi_tasklet); /* not safe to wake a vcpu here */
    1.25  }
    1.26  
    1.27  asmlinkage void mem_parity_error(struct cpu_user_regs *regs)
    1.28 @@ -2932,8 +2934,6 @@ void __init trap_init(void)
    1.29      percpu_traps_init();
    1.30  
    1.31      cpu_init();
    1.32 -
    1.33 -    open_softirq(NMI_SOFTIRQ, nmi_softirq);
    1.34  }
    1.35  
    1.36  long register_guest_nmi_callback(unsigned long address)
     2.1 --- a/xen/common/keyhandler.c	Fri Apr 11 15:37:48 2008 +0100
     2.2 +++ b/xen/common/keyhandler.c	Fri Apr 11 15:55:42 2008 +0100
     2.3 @@ -32,7 +32,7 @@ static struct {
     2.4  
     2.5  static unsigned char keypress_key;
     2.6  
     2.7 -static void keypress_softirq(void)
     2.8 +static void keypress_action(unsigned long unused)
     2.9  {
    2.10      keyhandler_t *h;
    2.11      unsigned char key = keypress_key;
    2.12 @@ -42,6 +42,8 @@ static void keypress_softirq(void)
    2.13      console_end_log_everything();
    2.14  }
    2.15  
    2.16 +static DECLARE_TASKLET(keypress_tasklet, keypress_action, 0);
    2.17 +
    2.18  void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
    2.19  {
    2.20      irq_keyhandler_t *h;
    2.21 @@ -56,7 +58,7 @@ void handle_keypress(unsigned char key, 
    2.22      else
    2.23      {
    2.24          keypress_key = key;
    2.25 -        raise_softirq(KEYPRESS_SOFTIRQ);
    2.26 +        tasklet_schedule(&keypress_tasklet);
    2.27      }
    2.28  }
    2.29  
    2.30 @@ -284,8 +286,6 @@ static void do_debug_key(unsigned char k
    2.31  
    2.32  void __init initialize_keytable(void)
    2.33  {
    2.34 -    open_softirq(KEYPRESS_SOFTIRQ, keypress_softirq);
    2.35 -
    2.36      register_irq_keyhandler(
    2.37          'd', dump_registers, "dump registers");
    2.38      register_keyhandler(
     3.1 --- a/xen/common/trace.c	Fri Apr 11 15:37:48 2008 +0100
     3.2 +++ b/xen/common/trace.c	Fri Apr 11 15:55:42 2008 +0100
     3.3 @@ -69,12 +69,6 @@ static cpumask_t tb_cpu_mask = CPU_MASK_
     3.4  /* which tracing events are enabled */
     3.5  static u32 tb_event_mask = TRC_ALL;
     3.6  
     3.7 -static void trace_notify_guest(void)
     3.8 -{
     3.9 -    send_guest_global_virq(dom0, VIRQ_TBUF);
    3.10 -}
    3.11 -
    3.12 -
    3.13  /**
    3.14   * alloc_trace_bufs - performs initialization of the per-cpu trace buffers.
    3.15   *
    3.16 @@ -120,7 +114,6 @@ static int alloc_trace_bufs(void)
    3.17      }
    3.18  
    3.19      t_buf_highwater = data_size >> 1; /* 50% high water */
    3.20 -    open_softirq(TRACE_SOFTIRQ, trace_notify_guest);
    3.21  
    3.22      return 0;
    3.23  }
    3.24 @@ -513,7 +506,7 @@ void __trace_var(u32 event, int cycles, 
    3.25      /* Notify trace buffer consumer that we've crossed the high water mark. */
    3.26      if ( started_below_highwater &&
    3.27           (calc_unconsumed_bytes(buf) >= t_buf_highwater) )
    3.28 -        raise_softirq(TRACE_SOFTIRQ);
    3.29 +        send_guest_global_virq(dom0, VIRQ_TBUF);
    3.30  }
    3.31  
    3.32  /*
     4.1 --- a/xen/include/xen/softirq.h	Fri Apr 11 15:37:48 2008 +0100
     4.2 +++ b/xen/include/xen/softirq.h	Fri Apr 11 15:55:42 2008 +0100
     4.3 @@ -6,10 +6,7 @@ enum {
     4.4      TIMER_SOFTIRQ = 0,
     4.5      SCHEDULE_SOFTIRQ,
     4.6      NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ,
     4.7 -    KEYPRESS_SOFTIRQ,
     4.8 -    NMI_SOFTIRQ,
     4.9      PAGE_SCRUB_SOFTIRQ,
    4.10 -    TRACE_SOFTIRQ,
    4.11      RCU_SOFTIRQ,
    4.12      STOPMACHINE_SOFTIRQ,
    4.13      TASKLET_SOFTIRQ,