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

[Xen-changelog] [xen-unstable] Turn some simple softirqs into tasklets.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1207925742 -3600
# Node ID d2010614d9f1cfa8b7accc9c324cb1ef49edf1e2
# Parent  96b099ad04973e26944b8ef8196be0fd2ffdabfa
Turn some simple softirqs into tasklets.

TRACE_SOFTIRQ does not appear to be necessary at all.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/traps.c      |    8 ++++----
 xen/common/keyhandler.c   |    8 ++++----
 xen/common/trace.c        |    9 +--------
 xen/include/xen/softirq.h |    3 ---
 4 files changed, 9 insertions(+), 19 deletions(-)

diff -r 96b099ad0497 -r d2010614d9f1 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Fri Apr 11 15:37:48 2008 +0100
+++ b/xen/arch/x86/traps.c      Fri Apr 11 15:55:42 2008 +0100
@@ -2637,12 +2637,14 @@ asmlinkage void do_general_protection(st
     panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code);
 }
 
-static void nmi_softirq(void)
+static void nmi_action(unsigned long unused)
 {
     /* Only used to defer wakeup of dom0,vcpu0 to a safe (non-NMI) context. */
     vcpu_kick(dom0->vcpu[0]);
 }
 
+static DECLARE_TASKLET(nmi_tasklet, nmi_action, 0);
+
 static void nmi_dom0_report(unsigned int reason_idx)
 {
     struct domain *d;
@@ -2654,7 +2656,7 @@ static void nmi_dom0_report(unsigned int
     set_bit(reason_idx, nmi_reason(d));
 
     if ( !test_and_set_bool(v->nmi_pending) )
-        raise_softirq(NMI_SOFTIRQ); /* not safe to wake up a vcpu here */
+        tasklet_schedule(&nmi_tasklet); /* not safe to wake a vcpu here */
 }
 
 asmlinkage void mem_parity_error(struct cpu_user_regs *regs)
@@ -2932,8 +2934,6 @@ void __init trap_init(void)
     percpu_traps_init();
 
     cpu_init();
-
-    open_softirq(NMI_SOFTIRQ, nmi_softirq);
 }
 
 long register_guest_nmi_callback(unsigned long address)
diff -r 96b099ad0497 -r d2010614d9f1 xen/common/keyhandler.c
--- a/xen/common/keyhandler.c   Fri Apr 11 15:37:48 2008 +0100
+++ b/xen/common/keyhandler.c   Fri Apr 11 15:55:42 2008 +0100
@@ -32,7 +32,7 @@ static struct {
 
 static unsigned char keypress_key;
 
-static void keypress_softirq(void)
+static void keypress_action(unsigned long unused)
 {
     keyhandler_t *h;
     unsigned char key = keypress_key;
@@ -42,6 +42,8 @@ static void keypress_softirq(void)
     console_end_log_everything();
 }
 
+static DECLARE_TASKLET(keypress_tasklet, keypress_action, 0);
+
 void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
 {
     irq_keyhandler_t *h;
@@ -56,7 +58,7 @@ void handle_keypress(unsigned char key, 
     else
     {
         keypress_key = key;
-        raise_softirq(KEYPRESS_SOFTIRQ);
+        tasklet_schedule(&keypress_tasklet);
     }
 }
 
@@ -284,8 +286,6 @@ static void do_debug_key(unsigned char k
 
 void __init initialize_keytable(void)
 {
-    open_softirq(KEYPRESS_SOFTIRQ, keypress_softirq);
-
     register_irq_keyhandler(
         'd', dump_registers, "dump registers");
     register_keyhandler(
diff -r 96b099ad0497 -r d2010614d9f1 xen/common/trace.c
--- a/xen/common/trace.c        Fri Apr 11 15:37:48 2008 +0100
+++ b/xen/common/trace.c        Fri Apr 11 15:55:42 2008 +0100
@@ -69,12 +69,6 @@ static cpumask_t tb_cpu_mask = CPU_MASK_
 /* which tracing events are enabled */
 static u32 tb_event_mask = TRC_ALL;
 
-static void trace_notify_guest(void)
-{
-    send_guest_global_virq(dom0, VIRQ_TBUF);
-}
-
-
 /**
  * alloc_trace_bufs - performs initialization of the per-cpu trace buffers.
  *
@@ -120,7 +114,6 @@ static int alloc_trace_bufs(void)
     }
 
     t_buf_highwater = data_size >> 1; /* 50% high water */
-    open_softirq(TRACE_SOFTIRQ, trace_notify_guest);
 
     return 0;
 }
@@ -513,7 +506,7 @@ void __trace_var(u32 event, int cycles, 
     /* Notify trace buffer consumer that we've crossed the high water mark. */
     if ( started_below_highwater &&
          (calc_unconsumed_bytes(buf) >= t_buf_highwater) )
-        raise_softirq(TRACE_SOFTIRQ);
+        send_guest_global_virq(dom0, VIRQ_TBUF);
 }
 
 /*
diff -r 96b099ad0497 -r d2010614d9f1 xen/include/xen/softirq.h
--- a/xen/include/xen/softirq.h Fri Apr 11 15:37:48 2008 +0100
+++ b/xen/include/xen/softirq.h Fri Apr 11 15:55:42 2008 +0100
@@ -6,10 +6,7 @@ enum {
     TIMER_SOFTIRQ = 0,
     SCHEDULE_SOFTIRQ,
     NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ,
-    KEYPRESS_SOFTIRQ,
-    NMI_SOFTIRQ,
     PAGE_SCRUB_SOFTIRQ,
-    TRACE_SOFTIRQ,
     RCU_SOFTIRQ,
     STOPMACHINE_SOFTIRQ,
     TASKLET_SOFTIRQ,

_______________________________________________
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®.