diff options
Diffstat (limited to 'kernel/softirq.c')
-rw-r--r-- | kernel/softirq.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c index 68eb5efec388..13960170cad4 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -54,11 +54,11 @@ EXPORT_SYMBOL(irq_stat); | |||
54 | 54 | ||
55 | static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp; | 55 | static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp; |
56 | 56 | ||
57 | static DEFINE_PER_CPU(struct task_struct *, ksoftirqd); | 57 | DEFINE_PER_CPU(struct task_struct *, ksoftirqd); |
58 | 58 | ||
59 | char *softirq_to_name[NR_SOFTIRQS] = { | 59 | char *softirq_to_name[NR_SOFTIRQS] = { |
60 | "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "BLOCK_IOPOLL", | 60 | "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "BLOCK_IOPOLL", |
61 | "TASKLET", "SCHED", "HRTIMER", "RCU" | 61 | "TASKLET", "SCHED", "HRTIMER" |
62 | }; | 62 | }; |
63 | 63 | ||
64 | /* | 64 | /* |
@@ -311,9 +311,21 @@ void irq_enter(void) | |||
311 | } | 311 | } |
312 | 312 | ||
313 | #ifdef __ARCH_IRQ_EXIT_IRQS_DISABLED | 313 | #ifdef __ARCH_IRQ_EXIT_IRQS_DISABLED |
314 | # define invoke_softirq() __do_softirq() | 314 | static inline void invoke_softirq(void) |
315 | { | ||
316 | if (!force_irqthreads) | ||
317 | __do_softirq(); | ||
318 | else | ||
319 | wakeup_softirqd(); | ||
320 | } | ||
315 | #else | 321 | #else |
316 | # define invoke_softirq() do_softirq() | 322 | static inline void invoke_softirq(void) |
323 | { | ||
324 | if (!force_irqthreads) | ||
325 | do_softirq(); | ||
326 | else | ||
327 | wakeup_softirqd(); | ||
328 | } | ||
317 | #endif | 329 | #endif |
318 | 330 | ||
319 | /* | 331 | /* |
@@ -555,7 +567,7 @@ static void __tasklet_hrtimer_trampoline(unsigned long data) | |||
555 | /** | 567 | /** |
556 | * tasklet_hrtimer_init - Init a tasklet/hrtimer combo for softirq callbacks | 568 | * tasklet_hrtimer_init - Init a tasklet/hrtimer combo for softirq callbacks |
557 | * @ttimer: tasklet_hrtimer which is initialized | 569 | * @ttimer: tasklet_hrtimer which is initialized |
558 | * @function: hrtimer callback funtion which gets called from softirq context | 570 | * @function: hrtimer callback function which gets called from softirq context |
559 | * @which_clock: clock id (CLOCK_MONOTONIC/CLOCK_REALTIME) | 571 | * @which_clock: clock id (CLOCK_MONOTONIC/CLOCK_REALTIME) |
560 | * @mode: hrtimer mode (HRTIMER_MODE_ABS/HRTIMER_MODE_REL) | 572 | * @mode: hrtimer mode (HRTIMER_MODE_ABS/HRTIMER_MODE_REL) |
561 | */ | 573 | */ |
@@ -721,7 +733,6 @@ static int run_ksoftirqd(void * __bind_cpu) | |||
721 | { | 733 | { |
722 | set_current_state(TASK_INTERRUPTIBLE); | 734 | set_current_state(TASK_INTERRUPTIBLE); |
723 | 735 | ||
724 | current->flags |= PF_KSOFTIRQD; | ||
725 | while (!kthread_should_stop()) { | 736 | while (!kthread_should_stop()) { |
726 | preempt_disable(); | 737 | preempt_disable(); |
727 | if (!local_softirq_pending()) { | 738 | if (!local_softirq_pending()) { |
@@ -738,7 +749,10 @@ static int run_ksoftirqd(void * __bind_cpu) | |||
738 | don't process */ | 749 | don't process */ |
739 | if (cpu_is_offline((long)__bind_cpu)) | 750 | if (cpu_is_offline((long)__bind_cpu)) |
740 | goto wait_to_die; | 751 | goto wait_to_die; |
741 | do_softirq(); | 752 | local_irq_disable(); |
753 | if (local_softirq_pending()) | ||
754 | __do_softirq(); | ||
755 | local_irq_enable(); | ||
742 | preempt_enable_no_resched(); | 756 | preempt_enable_no_resched(); |
743 | cond_resched(); | 757 | cond_resched(); |
744 | preempt_disable(); | 758 | preempt_disable(); |
@@ -831,7 +845,10 @@ static int __cpuinit cpu_callback(struct notifier_block *nfb, | |||
831 | switch (action) { | 845 | switch (action) { |
832 | case CPU_UP_PREPARE: | 846 | case CPU_UP_PREPARE: |
833 | case CPU_UP_PREPARE_FROZEN: | 847 | case CPU_UP_PREPARE_FROZEN: |
834 | p = kthread_create(run_ksoftirqd, hcpu, "ksoftirqd/%d", hotcpu); | 848 | p = kthread_create_on_node(run_ksoftirqd, |
849 | hcpu, | ||
850 | cpu_to_node(hotcpu), | ||
851 | "ksoftirqd/%d", hotcpu); | ||
835 | if (IS_ERR(p)) { | 852 | if (IS_ERR(p)) { |
836 | printk("ksoftirqd for %i failed\n", hotcpu); | 853 | printk("ksoftirqd for %i failed\n", hotcpu); |
837 | return notifier_from_errno(PTR_ERR(p)); | 854 | return notifier_from_errno(PTR_ERR(p)); |