From 4e3377d04b9bae258544c8573de87721f94a65b5 Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Wed, 7 Nov 2012 21:03:07 +0100 Subject: [PATCH] --- yaml --- r: 349834 b: refs/heads/master c: 00b42959106a9ca1c2899e591ae4e9a83ad6af05 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/irq_work.h | 6 ++++++ trunk/kernel/irq_work.c | 11 +++++++++++ trunk/kernel/time/tick-sched.c | 3 ++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 382e13ca72fd..7a515ada93cf 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 33a5f6261a61af28f7b4c86f9f958da0f206c914 +refs/heads/master: 00b42959106a9ca1c2899e591ae4e9a83ad6af05 diff --git a/trunk/include/linux/irq_work.h b/trunk/include/linux/irq_work.h index 6a9e8f5399e2..a69704f37204 100644 --- a/trunk/include/linux/irq_work.h +++ b/trunk/include/linux/irq_work.h @@ -20,4 +20,10 @@ bool irq_work_queue(struct irq_work *work); void irq_work_run(void); void irq_work_sync(struct irq_work *work); +#ifdef CONFIG_IRQ_WORK +bool irq_work_needs_cpu(void); +#else +static bool irq_work_needs_cpu(void) { return false; } +#endif + #endif /* _LINUX_IRQ_WORK_H */ diff --git a/trunk/kernel/irq_work.c b/trunk/kernel/irq_work.c index 64eddd59ed83..b3c113a14727 100644 --- a/trunk/kernel/irq_work.c +++ b/trunk/kernel/irq_work.c @@ -99,6 +99,17 @@ bool irq_work_queue(struct irq_work *work) } EXPORT_SYMBOL_GPL(irq_work_queue); +bool irq_work_needs_cpu(void) +{ + struct llist_head *this_list; + + this_list = &__get_cpu_var(irq_work_list); + if (llist_empty(this_list)) + return false; + + return true; +} + /* * Run the irq_work entries on this cpu. Requires to be ran from hardirq * context with local IRQs disabled. diff --git a/trunk/kernel/time/tick-sched.c b/trunk/kernel/time/tick-sched.c index 9e945aa090ac..f249e8c3e58e 100644 --- a/trunk/kernel/time/tick-sched.c +++ b/trunk/kernel/time/tick-sched.c @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -289,7 +290,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, } while (read_seqretry(&xtime_lock, seq)); if (rcu_needs_cpu(cpu, &rcu_delta_jiffies) || printk_needs_cpu(cpu) || - arch_needs_cpu(cpu)) { + arch_needs_cpu(cpu) || irq_work_needs_cpu()) { next_jiffies = last_jiffies + 1; delta_jiffies = 1; } else {