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@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx> Cc: Venki Pallipadi <venkatesh.pallipadi@xxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: Arjan van de Ven <arjan@xxxxxxxxxxxxx> Cc: Matthew Garrett <mjg59@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- 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@xxxxxxxxxxxxxxxx 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 -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html