Commit 23aafe08 authored by David S. Miller's avatar David S. Miller

[SOFTIRQ]: Define local_softirq_pending, use it in softirq.c

Platforms, such as IA64, have a per-cpu mapping for local cpu
data.  When we killed off asm/softirq.h, we removed the usage
of local_softirq_pending IA64 was using.  By defining a generic
version we can put the optimization back.
parent b99949d5
...@@ -29,6 +29,7 @@ extern irq_cpustat_t irq_stat[]; /* defined in asm/hardirq.h */ ...@@ -29,6 +29,7 @@ extern irq_cpustat_t irq_stat[]; /* defined in asm/hardirq.h */
/* arch independent irq_stat fields */ /* arch independent irq_stat fields */
#define softirq_pending(cpu) __IRQ_STAT((cpu), __softirq_pending) #define softirq_pending(cpu) __IRQ_STAT((cpu), __softirq_pending)
#define local_softirq_pending() softirq_pending(smp_processor_id())
#define syscall_count(cpu) __IRQ_STAT((cpu), __syscall_count) #define syscall_count(cpu) __IRQ_STAT((cpu), __syscall_count)
#define ksoftirqd_task(cpu) __IRQ_STAT((cpu), __ksoftirqd_task) #define ksoftirqd_task(cpu) __IRQ_STAT((cpu), __ksoftirqd_task)
/* arch dependent irq_stat fields */ /* arch dependent irq_stat fields */
......
...@@ -56,15 +56,13 @@ asmlinkage void do_softirq() ...@@ -56,15 +56,13 @@ asmlinkage void do_softirq()
__u32 pending; __u32 pending;
unsigned long flags; unsigned long flags;
__u32 mask; __u32 mask;
int cpu;
if (in_interrupt()) if (in_interrupt())
return; return;
local_irq_save(flags); local_irq_save(flags);
cpu = smp_processor_id();
pending = softirq_pending(cpu); pending = local_softirq_pending();
if (pending) { if (pending) {
struct softirq_action *h; struct softirq_action *h;
...@@ -73,7 +71,7 @@ asmlinkage void do_softirq() ...@@ -73,7 +71,7 @@ asmlinkage void do_softirq()
local_bh_disable(); local_bh_disable();
restart: restart:
/* Reset the pending bitmask before enabling irqs */ /* Reset the pending bitmask before enabling irqs */
softirq_pending(cpu) = 0; local_softirq_pending() = 0;
local_irq_enable(); local_irq_enable();
...@@ -88,13 +86,13 @@ asmlinkage void do_softirq() ...@@ -88,13 +86,13 @@ asmlinkage void do_softirq()
local_irq_disable(); local_irq_disable();
pending = softirq_pending(cpu); pending = local_softirq_pending();
if (pending & mask) { if (pending & mask) {
mask &= ~pending; mask &= ~pending;
goto restart; goto restart;
} }
if (pending) if (pending)
wakeup_softirqd(cpu); wakeup_softirqd(smp_processor_id());
__local_bh_enable(); __local_bh_enable();
} }
...@@ -106,7 +104,7 @@ void local_bh_enable(void) ...@@ -106,7 +104,7 @@ void local_bh_enable(void)
__local_bh_enable(); __local_bh_enable();
BUG_ON(irqs_disabled()); BUG_ON(irqs_disabled());
if (unlikely(!in_interrupt() && if (unlikely(!in_interrupt() &&
softirq_pending(smp_processor_id()))) local_softirq_pending()))
do_softirq(); do_softirq();
preempt_check_resched(); preempt_check_resched();
} }
...@@ -326,12 +324,12 @@ static int ksoftirqd(void * __bind_cpu) ...@@ -326,12 +324,12 @@ static int ksoftirqd(void * __bind_cpu)
ksoftirqd_task(cpu) = current; ksoftirqd_task(cpu) = current;
for (;;) { for (;;) {
if (!softirq_pending(cpu)) if (!local_softirq_pending())
schedule(); schedule();
__set_current_state(TASK_RUNNING); __set_current_state(TASK_RUNNING);
while (softirq_pending(cpu)) { while (local_softirq_pending()) {
do_softirq(); do_softirq();
cond_resched(); cond_resched();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment