diff options
author | kfraser@dhcp93.uk.xensource.com <kfraser@dhcp93.uk.xensource.com> | 2006-06-30 13:25:43 +0100 |
---|---|---|
committer | kfraser@dhcp93.uk.xensource.com <kfraser@dhcp93.uk.xensource.com> | 2006-06-30 13:25:43 +0100 |
commit | ae9bfcdced916158809e832ffca289761ab8d9cf (patch) | |
tree | a62d2319e6a77db62d9d1ebb431dabcf998b655e /xen/common/softirq.c | |
parent | 0968f0be1f81bd75a465be5c9e7dc4469ce90d95 (diff) | |
download | xen-ae9bfcdced916158809e832ffca289761ab8d9cf.tar.gz xen-ae9bfcdced916158809e832ffca289761ab8d9cf.tar.bz2 xen-ae9bfcdced916158809e832ffca289761ab8d9cf.zip |
[XEN] Various softirq cleanups. Main one is to always
call smp_processor_id() after any softirq, as rescheduling
may cause us to move to another processor on ia64
(spotted by Isaku Yamahata). Also get rid of many direct
callers of do_softirq() by creating new function
process_pending_timers().
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common/softirq.c')
-rw-r--r-- | xen/common/softirq.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/xen/common/softirq.c b/xen/common/softirq.c index f8a2c3780c..fb220694fe 100644 --- a/xen/common/softirq.c +++ b/xen/common/softirq.c @@ -23,17 +23,23 @@ static softirq_handler softirq_handlers[NR_SOFTIRQS]; asmlinkage void do_softirq(void) { - unsigned int i, cpu = smp_processor_id(); + unsigned int i, cpu; unsigned long pending; - pending = softirq_pending(cpu); - ASSERT(pending != 0); + for ( ; ; ) + { + /* + * Initialise @cpu on every iteration: SCHEDULE_SOFTIRQ may move + * us to another processor. + */ + cpu = smp_processor_id(); + if ( (pending = softirq_pending(cpu)) == 0 ) + break; - do { i = find_first_set_bit(pending); clear_bit(i, &softirq_pending(cpu)); (*softirq_handlers[i])(); - } while ( (pending = softirq_pending(cpu)) != 0 ); + } } void open_softirq(int nr, softirq_handler handler) |