Linux MM tree latest commits
 help / color / mirror / Atom feed
* + timer-add-on-stack-deferrable-timer-interfaces.patch added to -mm tree
@ 2010-05-14 23:11 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2010-05-14 23:11 UTC (permalink / raw)
  To: mm-commits; +Cc: jbarnes, arjan, hpa, mingo, mjg59, tglx, venkatesh.pallipadi


The patch titled
     timer: add on-stack deferrable timer interfaces
has been added to the -mm tree.  Its filename is
     timer-add-on-stack-deferrable-timer-interfaces.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: timer: add on-stack deferrable timer interfaces
From: Jesse Barnes <jbarnes@virtuousgeek.org>

In some cases (for instance with kernel threads) it may be desireable to
use on-stack deferrable timers to get their power saving benefits.  Add
interfaces to support this for the IPS driver.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Venki Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/timer.h |   15 +++++++++++++++
 kernel/timer.c        |   13 +++++++++++++
 2 files changed, 28 insertions(+)

diff -puN include/linux/timer.h~timer-add-on-stack-deferrable-timer-interfaces include/linux/timer.h
--- a/include/linux/timer.h~timer-add-on-stack-deferrable-timer-interfaces
+++ a/include/linux/timer.h
@@ -100,6 +100,13 @@ void init_timer_deferrable_key(struct ti
 		setup_timer_on_stack_key((timer), #timer, &__key,	\
 					 (fn), (data));			\
 	} while (0)
+#define setup_deferrable_timer_on_stack(timer, fn, data)		\
+	do {								\
+		static struct lock_class_key __key;			\
+		setup_deferrable_timer_on_stack_key((timer), #timer,	\
+						    &__key, (fn),	\
+						    (data));		\
+	} while (0)
 #else
 #define init_timer(timer)\
 	init_timer_key((timer), NULL, NULL)
@@ -111,6 +118,8 @@ void init_timer_deferrable_key(struct ti
 	setup_timer_key((timer), NULL, NULL, (fn), (data))
 #define setup_timer_on_stack(timer, fn, data)\
 	setup_timer_on_stack_key((timer), NULL, NULL, (fn), (data))
+#define setup_deferrable_timer_on_stack(timer, fn, data)\
+	setup_deferrable_timer_on_stack_key((timer), NULL, NULL, (fn), (data))
 #endif
 
 #ifdef CONFIG_DEBUG_OBJECTS_TIMERS
@@ -150,6 +159,12 @@ static inline void setup_timer_on_stack_
 	init_timer_on_stack_key(timer, name, key);
 }
 
+extern void setup_deferrable_timer_on_stack_key(struct timer_list *timer,
+						const char *name,
+						struct lock_class_key *key,
+						void (*function)(unsigned long),
+						unsigned long data);
+
 /**
  * timer_pending - is a timer pending?
  * @timer: the timer in question
diff -puN kernel/timer.c~timer-add-on-stack-deferrable-timer-interfaces kernel/timer.c
--- a/kernel/timer.c~timer-add-on-stack-deferrable-timer-interfaces
+++ a/kernel/timer.c
@@ -577,6 +577,19 @@ static void __init_timer(struct timer_li
 	lockdep_init_map(&timer->lockdep_map, name, key, 0);
 }
 
+void setup_deferrable_timer_on_stack_key(struct timer_list *timer,
+					 const char *name,
+					 struct lock_class_key *key,
+					 void (*function)(unsigned long),
+					 unsigned long data)
+{
+	timer->function = function;
+	timer->data = data;
+	init_timer_on_stack_key(timer, name, key);
+	timer_set_deferrable(timer);
+}
+EXPORT_SYMBOL_GPL(setup_deferrable_timer_on_stack_key);
+
 /**
  * init_timer_key - initialize a timer
  * @timer: the timer to be initialized
_

Patches currently in -mm which might be from jbarnes@virtuousgeek.org are

origin.patch
linux-next.patch
drivers-pci-intel-iommuc-errors-with-smaller-iommu-widths.patch
drivers-pci-intel-iommuc-errors-with-smaller-iommu-widths-fix.patch
timer-add-on-stack-deferrable-timer-interfaces.patch
x86-platform-driver-intelligent-power-sharing-driver.patch
agp-amd64-fix-pci-reference-leaks.patch
panic-allow-taint-flag-for-warnings-to-be-changed-from-taint_warn.patch
panic-add-taint-flag-taint_firmware_workaround-i.patch
pci-dmar-combine-the-bios-dmar-table-warning-messages.patch
pci-dmar-tone-down-warnings-about-invalid-bios-dmar-tables.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-14 23:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-14 23:11 + timer-add-on-stack-deferrable-timer-interfaces.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox