aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/softirq.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-12-22 18:35:34 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-12-22 18:35:34 +0000
commite3300fe7e9cc5d6395f744b1ee450bbb09c9410c (patch)
tree23752ef216c306d3ad0db5337f8a9a42e6382e88 /xen/common/softirq.c
parent4d45702cf0398fda384ba980729032315548919b (diff)
downloadxen-e3300fe7e9cc5d6395f744b1ee450bbb09c9410c.tar.gz
xen-e3300fe7e9cc5d6395f744b1ee450bbb09c9410c.tar.bz2
xen-e3300fe7e9cc5d6395f744b1ee450bbb09c9410c.zip
Replace process_pending_timers() with process_pending_softirqs().
This ensures that any critical softirqs are handled in a timely manner (e.g., TIME_CALIBRATE_SOFTIRQ) while still avoiding being preempted by the scheduler (by SCHEDULE_SOFTIRQ), which is the reason for avoiding use of do_softirq() directly. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/common/softirq.c')
-rw-r--r--xen/common/softirq.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/xen/common/softirq.c b/xen/common/softirq.c
index ecf3379388..7b04f36f2d 100644
--- a/xen/common/softirq.c
+++ b/xen/common/softirq.c
@@ -22,7 +22,7 @@ irq_cpustat_t irq_stat[NR_CPUS];
static softirq_handler softirq_handlers[NR_SOFTIRQS];
-asmlinkage void do_softirq(void)
+static void __do_softirq(unsigned long ignore_mask)
{
unsigned int i, cpu;
unsigned long pending;
@@ -38,7 +38,7 @@ asmlinkage void do_softirq(void)
if ( rcu_pending(cpu) )
rcu_check_callbacks(cpu);
- if ( (pending = softirq_pending(cpu)) == 0 )
+ if ( (pending = (softirq_pending(cpu) & ~ignore_mask)) == 0 )
break;
i = find_first_set_bit(pending);
@@ -47,6 +47,18 @@ asmlinkage void do_softirq(void)
}
}
+void process_pending_softirqs(void)
+{
+ ASSERT(!in_irq() && local_irq_is_enabled());
+ /* Do not enter scheduler as it can preempt the calling context. */
+ __do_softirq(1ul<<SCHEDULE_SOFTIRQ);
+}
+
+asmlinkage void do_softirq(void)
+{
+ __do_softirq(0);
+}
+
void open_softirq(int nr, softirq_handler handler)
{
ASSERT(nr < NR_SOFTIRQS);