Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349834
b: refs/heads/master
c: 00b4295
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker committed Nov 17, 2012
1 parent 5a14e4f commit 4e3377d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33a5f6261a61af28f7b4c86f9f958da0f206c914
refs/heads/master: 00b42959106a9ca1c2899e591ae4e9a83ad6af05
6 changes: 6 additions & 0 deletions trunk/include/linux/irq_work.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
11 changes: 11 additions & 0 deletions trunk/kernel/irq_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion trunk/kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/profile.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/irq_work.h>

#include <asm/irq_regs.h>

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 4e3377d

Please sign in to comment.