diff options
Diffstat (limited to 'kernel/softirq.c')
| -rw-r--r-- | kernel/softirq.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c index 21939d9e830e..7c1a67ef0274 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
| @@ -500,22 +500,17 @@ EXPORT_SYMBOL(tasklet_kill); | |||
| 500 | */ | 500 | */ |
| 501 | 501 | ||
| 502 | /* | 502 | /* |
| 503 | * The trampoline is called when the hrtimer expires. If this is | 503 | * The trampoline is called when the hrtimer expires. It schedules a tasklet |
| 504 | * called from the hrtimer interrupt then we schedule the tasklet as | 504 | * to run __tasklet_hrtimer_trampoline() which in turn will call the intended |
| 505 | * the timer callback function expects to run in softirq context. If | 505 | * hrtimer callback, but from softirq context. |
| 506 | * it's called in softirq context anyway (i.e. high resolution timers | ||
| 507 | * disabled) then the hrtimer callback is called right away. | ||
| 508 | */ | 506 | */ |
| 509 | static enum hrtimer_restart __hrtimer_tasklet_trampoline(struct hrtimer *timer) | 507 | static enum hrtimer_restart __hrtimer_tasklet_trampoline(struct hrtimer *timer) |
| 510 | { | 508 | { |
| 511 | struct tasklet_hrtimer *ttimer = | 509 | struct tasklet_hrtimer *ttimer = |
| 512 | container_of(timer, struct tasklet_hrtimer, timer); | 510 | container_of(timer, struct tasklet_hrtimer, timer); |
| 513 | 511 | ||
| 514 | if (hrtimer_is_hres_active(timer)) { | 512 | tasklet_hi_schedule(&ttimer->tasklet); |
| 515 | tasklet_hi_schedule(&ttimer->tasklet); | 513 | return HRTIMER_NORESTART; |
| 516 | return HRTIMER_NORESTART; | ||
| 517 | } | ||
| 518 | return ttimer->function(timer); | ||
| 519 | } | 514 | } |
| 520 | 515 | ||
| 521 | /* | 516 | /* |
| @@ -697,7 +692,7 @@ void __init softirq_init(void) | |||
| 697 | open_softirq(HI_SOFTIRQ, tasklet_hi_action); | 692 | open_softirq(HI_SOFTIRQ, tasklet_hi_action); |
| 698 | } | 693 | } |
| 699 | 694 | ||
| 700 | static int ksoftirqd(void * __bind_cpu) | 695 | static int run_ksoftirqd(void * __bind_cpu) |
| 701 | { | 696 | { |
| 702 | set_current_state(TASK_INTERRUPTIBLE); | 697 | set_current_state(TASK_INTERRUPTIBLE); |
| 703 | 698 | ||
| @@ -810,7 +805,7 @@ static int __cpuinit cpu_callback(struct notifier_block *nfb, | |||
| 810 | switch (action) { | 805 | switch (action) { |
| 811 | case CPU_UP_PREPARE: | 806 | case CPU_UP_PREPARE: |
| 812 | case CPU_UP_PREPARE_FROZEN: | 807 | case CPU_UP_PREPARE_FROZEN: |
| 813 | p = kthread_create(ksoftirqd, hcpu, "ksoftirqd/%d", hotcpu); | 808 | p = kthread_create(run_ksoftirqd, hcpu, "ksoftirqd/%d", hotcpu); |
| 814 | if (IS_ERR(p)) { | 809 | if (IS_ERR(p)) { |
| 815 | printk("ksoftirqd for %i failed\n", hotcpu); | 810 | printk("ksoftirqd for %i failed\n", hotcpu); |
| 816 | return NOTIFY_BAD; | 811 | return NOTIFY_BAD; |
