--- zzzz-none-000/linux-2.4.17/kernel/softirq.c 2001-10-31 18:26:02.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/kernel/softirq.c 2004-11-24 13:21:27.000000000 +0000 @@ -17,6 +17,8 @@ #include #include +#include + /* - No shared variables, all the data are CPU local. - If a softirq needs serialization, let it serialize itself @@ -44,6 +46,18 @@ static struct softirq_action softirq_vec[32] __cacheline_aligned; +#ifdef CONFIG_PREEMPT_TIMES +extern void latency_cause(int,int); +#else +#define latency_cause(a, b) +#endif + +void trigger_softirq(void) +{ + if(softirq_pending(smp_processor_id())) + do_softirq(); +} + /* * we cannot loop indefinitely here to avoid userspace starvation, * but we also don't want to introduce a worst case 1/HZ latency @@ -67,6 +81,7 @@ if (in_interrupt()) return; + preempt_lock_start(-99); local_irq_save(flags); @@ -84,10 +99,15 @@ local_irq_enable(); h = softirq_vec; + + latency_cause(-100, pending); + do { - if (pending & 1) + if (pending & 1) { + TRACE_SOFT_IRQ(TRACE_EV_SOFT_IRQ_SOFT_IRQ, (h - softirq_vec)); h->action(h); + } h++; pending >>= 1; } while (pending); @@ -95,7 +115,8 @@ local_irq_disable(); pending = softirq_pending(cpu); - if (pending & mask) { + + if (pending & (mask | ALWAYS_SOFTIRQ)) { mask &= ~pending; goto restart; } @@ -106,6 +127,14 @@ } local_irq_restore(flags); +#ifdef CONFIG_ILATENCY + /* + * If you have entry.S whacked up to call intr_ret_from_exception + * you can remove this call, unfortunately, MIPs and ARM don't + * have a simple way to do this for now so we catch them all here . . + */ + intr_ret_from_exception(); +#endif } /* @@ -192,6 +221,9 @@ if (!atomic_read(&t->count)) { if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) BUG(); + + TRACE_SOFT_IRQ(TRACE_EV_SOFT_IRQ_TASKLET_ACTION, (unsigned long) (t->func)); + t->func(t->data); tasklet_unlock(t); continue; @@ -226,6 +258,9 @@ if (!atomic_read(&t->count)) { if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) BUG(); + + TRACE_SOFT_IRQ(TRACE_EV_SOFT_IRQ_TASKLET_HI_ACTION, (unsigned long) (t->func)); + t->func(t->data); tasklet_unlock(t); continue; @@ -296,8 +331,10 @@ if (!hardirq_trylock(cpu)) goto resched_unlock; - if (bh_base[nr]) + if (bh_base[nr]){ + TRACE_SOFT_IRQ(TRACE_EV_SOFT_IRQ_BOTTOM_HALF, (nr)); bh_base[nr](); + } hardirq_endlock(cpu); spin_unlock(&global_bh_lock); @@ -330,6 +367,7 @@ open_softirq(TASKLET_SOFTIRQ, tasklet_action, NULL); open_softirq(HI_SOFTIRQ, tasklet_hi_action, NULL); + open_softirq(RUN_TIMER_LIST,timer_softirq, NULL); } void __run_task_queue(task_queue *list)