All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH 1/5] hrtimer: splitout peek ahead functionality
Date: Mon, 05 Jan 2009 11:28:19 +0100	[thread overview]
Message-ID: <20090105103136.092137470@chello.nl> (raw)
In-Reply-To: 20090105102818.829119334@chello.nl

[-- Attachment #1: hrtimers-splitout-peek-ahead-functionality.patch --]
[-- Type: text/plain, Size: 1385 bytes --]

From: Thomas Gleixner <tglx@linutronix.de>

Provide a peek ahead function that assumes irqs disabled, allows for micro
optimizations.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
 kernel/hrtimer.c |   24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

Index: linux-2.6-tip/kernel/hrtimer.c
===================================================================
--- linux-2.6-tip.orig/kernel/hrtimer.c
+++ linux-2.6-tip/kernel/hrtimer.c
@@ -1244,6 +1244,22 @@ void hrtimer_interrupt(struct clock_even
 	}
 }
 
+/*
+ * local version of hrtimer_peek_ahead_timers() called with interrupts
+ * disabled.
+ */
+static void __hrtimer_peek_ahead_timers(void)
+{
+	struct tick_device *td;
+
+	if (!hrtimer_hres_active())
+		return;
+
+	td = &__get_cpu_var(tick_cpu_device);
+	if (td && td->evtdev)
+		hrtimer_interrupt(td->evtdev);
+}
+
 /**
  * hrtimer_peek_ahead_timers -- run soft-expired timers now
  *
@@ -1255,16 +1271,10 @@ void hrtimer_interrupt(struct clock_even
  */
 void hrtimer_peek_ahead_timers(void)
 {
-	struct tick_device *td;
 	unsigned long flags;
 
-	if (!hrtimer_hres_active())
-		return;
-
 	local_irq_save(flags);
-	td = &__get_cpu_var(tick_cpu_device);
-	if (td && td->evtdev)
-		hrtimer_interrupt(td->evtdev);
+	__hrtimer_peek_ahead_timers();
 	local_irq_restore(flags);
 }
 

-- 


  reply	other threads:[~2009-01-05 11:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-05 10:28 [PATCH 0/5] hrtimer: cleanups and fixes Peter Zijlstra
2009-01-05 10:28 ` Peter Zijlstra [this message]
2009-01-05 10:28 ` [PATCH 2/5] hrtimer: fix HOTPLUG_CPU=n compile warning Peter Zijlstra
2009-01-05 10:28 ` [PATCH 3/5] hrtimer: simplify hotplug migration Peter Zijlstra
2009-01-05 10:28 ` [PATCH 4/5] hrtimer: fix recursion deadlock by re-introducing the softirq Peter Zijlstra
2009-01-05 10:28 ` [PATCH 5/5] hrtimer: fixup comments Peter Zijlstra
2009-01-05 12:15 ` [PATCH 0/5] hrtimer: cleanups and fixes Ingo Molnar
2009-01-05 13:13   ` [PATCH] hrtimer: splitout peek ahead functionality, fix Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090105103136.092137470@chello.nl \
    --to=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=svaidy@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.