Skip to contentSkip to conversation

hrtimer_tasklet infrastructure for 2.6.31

GIT PULL Thomas Gleixner 1 participant 1 message Jul 22, 2009

lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest core-fixes-for-linus-2 git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git core-fixes-for-linus-2

This implements the generic infrastructure which is neccesary to keep the softirq assumptions of hrtimer users intact. Network folks are waiting for it.

Peter moved it to softirq.c as requested and we added the necessary helper functions and documentation/comments.

Thanks,

tglx

------------------>
Peter Zijlstra (1):
softirq: introduce tasklet_hrtimer infrastructure

 include/linux/interrupt.h |   26 ++++++++++++++++++
 kernel/softirq.c          |   64 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 89 insertions(+), 1 deletions(-)
include/linux/interrupt.h +26 -0
index 2721f07..fd4c9c6 100644
@@ -14,6 +14,7 @@
 #include <linux/irqflags.h>
 #include <linux/smp.h>
 #include <linux/percpu.h>
+#include <linux/hrtimer.h>
 
 #include <asm/atomic.h>
 #include <asm/ptrace.h>
@@ -517,6 +518,31 @@ extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
 extern void tasklet_init(struct tasklet_struct *t,
 			 void (*func)(unsigned long), unsigned long data);
 
+struct tasklet_hrtimer {
+	struct hrtimer		timer;
+	struct tasklet_struct	tasklet;
+	enum hrtimer_restart	(*function)(struct hrtimer *);
+};
+
+extern void
+tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
+		     enum hrtimer_restart (*function)(struct hrtimer *),
+		     clockid_t which_clock, enum hrtimer_mode mode);
+
+static inline
+int tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time,
+			  const enum hrtimer_mode mode)
+{
+	return hrtimer_start(&ttimer->timer, time, mode);
+}
+
+static inline
+void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer)
+{
+	hrtimer_cancel(&ttimer->timer);
+	tasklet_kill(&ttimer->tasklet);
+}
+
 /*
  * Autoprobing for irqs:
  *
kernel/softirq.c +63 -1

76 lines not on this page · raw message