Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366184
b: refs/heads/master
c: 0ed2aef
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner committed Apr 3, 2013
1 parent 556d810 commit 6407ede
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 63 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: 8011657b9e63cb2e914b9a0f75233b910c1854cb
refs/heads/master: 0ed2aef9b3bffe598045b62a31a50d912eee92d8
11 changes: 10 additions & 1 deletion trunk/arch/arm/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,16 @@ void cpu_idle(void)
#ifdef CONFIG_PL310_ERRATA_769419
wmb();
#endif
if (hlt_counter) {
/*
* In poll mode we reenable interrupts and spin.
*
* Also if we detected in the wakeup from idle
* path that the tick broadcast device expired
* for us, we don't want to go deep idle as we
* know that the IPI is going to arrive right
* away
*/
if (hlt_counter || tick_check_broadcast_expired()) {
local_irq_enable();
cpu_relax();
} else if (!need_resched()) {
Expand Down
12 changes: 12 additions & 0 deletions trunk/arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,18 @@ void cpu_idle(void)
local_touch_nmi();
local_irq_disable();

/*
* We detected in the wakeup path that the
* tick broadcast device expired for us, but
* we raced with the other CPU and came back
* here before it was able to fire the IPI.
* No point in going idle.
*/
if (tick_check_broadcast_expired()) {
local_irq_enable();
continue;
}

enter_idle();

/* Don't trace irqs off for idle */
Expand Down
12 changes: 12 additions & 0 deletions trunk/include/linux/clockchips.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ enum clock_event_nofitiers {
#define CLOCK_EVT_FEAT_C3STOP 0x000008
#define CLOCK_EVT_FEAT_DUMMY 0x000010

/*
* Core shall set the interrupt affinity dynamically in broadcast mode
*/
#define CLOCK_EVT_FEAT_DYNIRQ 0x000020

/**
* struct clock_event_device - clock event device descriptor
* @event_handler: Assigned by the framework to be called by the low
Expand Down Expand Up @@ -170,6 +175,12 @@ extern void tick_broadcast(const struct cpumask *mask);
extern int tick_receive_broadcast(void);
#endif

#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT)
extern int tick_check_broadcast_expired(void);
#else
static inline int tick_check_broadcast_expired(void) { return 0; }
#endif

#ifdef CONFIG_GENERIC_CLOCKEVENTS
extern void clockevents_notify(unsigned long reason, void *arg);
#else
Expand All @@ -182,6 +193,7 @@ static inline void clockevents_suspend(void) {}
static inline void clockevents_resume(void) {}

#define clockevents_notify(reason, arg) do { } while (0)
static inline int tick_check_broadcast_expired(void) { return 0; }

#endif

Expand Down
2 changes: 1 addition & 1 deletion trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ asmlinkage void __init start_kernel(void)
* Interrupts are still disabled. Do necessary setups, then
* enable them
*/
tick_init();
boot_cpu_init();
page_address_init();
printk(KERN_NOTICE "%s", linux_banner);
Expand Down Expand Up @@ -551,6 +550,7 @@ asmlinkage void __init start_kernel(void)
/* init some links before init_ISA_irqs() */
early_irq_init();
init_IRQ();
tick_init();
init_timers();
hrtimers_init();
softirq_init();
Expand Down
6 changes: 4 additions & 2 deletions trunk/kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,8 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
* @timer: the timer to be added
* @tim: expiry time
* @delta_ns: "slack" range for the timer
* @mode: expiry mode: absolute (HRTIMER_ABS) or relative (HRTIMER_REL)
* @mode: expiry mode: absolute (HRTIMER_MODE_ABS) or
* relative (HRTIMER_MODE_REL)
*
* Returns:
* 0 on success
Expand All @@ -1039,7 +1040,8 @@ EXPORT_SYMBOL_GPL(hrtimer_start_range_ns);
* hrtimer_start - (re)start an hrtimer on the current CPU
* @timer: the timer to be added
* @tim: expiry time
* @mode: expiry mode: absolute (HRTIMER_ABS) or relative (HRTIMER_REL)
* @mode: expiry mode: absolute (HRTIMER_MODE_ABS) or
* relative (HRTIMER_MODE_REL)
*
* Returns:
* 0 on success
Expand Down
Loading

0 comments on commit 6407ede

Please sign in to comment.