Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1430707 > unrolled thread
| Started by | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| First post | 2016-06-24 16:40 +0200 |
| Last post | 2016-06-24 16:40 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[patch V3 20/22] timer: Only wake softirq if necessary Thomas Gleixner <tglx@linutronix.de> - 2016-06-24 16:40 +0200
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Date | 2016-06-24 16:40 +0200 |
| Subject | [patch V3 20/22] timer: Only wake softirq if necessary |
| Message-ID | <rNAr0-NX-29@gated-at.bofh.it> |
With the wheel forwading in place and with the HZ=1000 4ms folding we can
avoid running the softirq at all.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/time/timer.c | 11 +++++++++++
1 file changed, 11 insertions(+)
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1599,7 +1599,18 @@ static void run_timer_softirq(struct sof
*/
void run_local_timers(void)
{
+ struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]);
+
hrtimer_run_queues();
+ /* Raise the softirq only if required. */
+ if (time_before(jiffies, base->clk)) {
+ if (!IS_ENABLED(CONFIG_NO_HZ_COMMON) || !base->nohz_active)
+ return;
+ /* CPU is awake, so check the deferrable base. */
+ base++;
+ if (time_before(jiffies, base->clk))
+ return;
+ }
raise_softirq(TIMER_SOFTIRQ);
}
Back to top | Article view | linux.kernel
csiph-web