Skip to contentSkip to conversation

timer updates for v2.6.30

GIT PULL Ingo Molnar 1 participant 1 message Mar 26, 2009

Subsystems (11)
Documentation x86 PowerPC PCI +7 more subsystems
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest timers-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git timers-for-linus

Highlights:

- New mod_timer_pending() timer_list API requested by the networking folks.

- HPET ICH10 enablement and general debuggability improvements and fixlets.

- NTP code cleanups and fixlets.

Risks:

- There were no unusual trouble spots during development and there are no open regressions.

- The ICH10 force-enable hpet change brings regression risks on such systems and the NTP changes have regression risks too.

Thanks,

Ingo

------------------>
Andi Kleen (1):
x86: hpet: allow force enable on ICH10 HPET

Andreas Herrmann (3):
x86: hpet: print HPET registers during setup (if hpet=verbose is used)
x86: hpet: provide separate functions to stop and start the counter
x86: hpet: stop HPET_COUNTER when programming periodic mode

Frederic Weisbecker (1):
hrtimers: increase clock min delta threshold while interrupt hanging

Ingo Molnar (15):
timers: add mod_timer_pending()
time: ntp: clean up kernel/time/ntp.c
time: ntp: simplify the second_overflow() code flow
time: ntp: simplify the MAX_TICKADJ_SCALED definition
time: ntp: clean up ntp_update_frequency()
time: ntp: refactor up ntp_update_frequency()
time: ntp: refactor and clean up ntp_update_offset()
time: ntp: simplify ntp_update_offset_fll()
time: ntp: micro-optimize ntp_update_offset()
time: ntp: fix bug in ntp_update_offset() & do_adjtimex()
time: ntp: refactor do_adjtimex()
time: ntp: refactor do_adjtimex() some more
time: ntp: make 64-bit constants more robust
time: ntp: simplify ntp_tick_adj calculations
time: ntp: clean up second_overflow()

John Stultz (2):
time: apply NTP frequency/tick changes immediately
time: ntp: fix bug in ntp_update_offset() & do_adjtimex(), fix

Magnus Damm (1):
clockevents: let set_mode() setup delta information

Oleg Nesterov (1):

      posix timers: fix RLIMIT_CPU && fork()

Sebastien Dugue (1):
hrtimers: allow the hot-unplugging of all cpus

Thomas Gleixner (1):
hrtimer: prevent negative expiry value after clock_was_set()

 Documentation/kernel-parameters.txt        |    4 +-
 arch/powerpc/platforms/cell/spufs/sched.c  |    2 +-
 arch/x86/kernel/hpet.c                     |   80 ++++-
 arch/x86/kernel/quirks.c                   |    3 +-
 drivers/infiniband/hw/ipath/ipath_driver.c |    6 +-
 include/linux/timer.h                      |   22 +--
 include/linux/timex.h                      |    2 +-
 kernel/posix-cpu-timers.c                  |    3 +-
 kernel/relay.c                             |    2 +-
 kernel/time/clockevents.c                  |   20 +-
 kernel/time/ntp.c                          |  444 +++++++++++++++++-----------
 kernel/timer.c                             |  110 +++++---
 12 files changed, 437 insertions(+), 261 deletions(-)
Documentation/kernel-parameters.txt +3 -1
index 54f21a5..46d11a9 100644
@@ -492,10 +492,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			Default: 64
 
 	hpet=		[X86-32,HPET] option to control HPET usage
-			Format: { enable (default) | disable | force }
+			Format: { enable (default) | disable | force |
+				verbose }
 			disable: disable HPET and use PIT instead
 			force: allow force enabled of undocumented chips (ICH4,
 			VIA, nVidia)
+			verbose: show contents of HPET registers during setup
 
 	com20020=	[HW,NET] ARCnet - COM20020 chipset
 			Format:
arch/powerpc/platforms/cell/spufs/sched.c +1 -1
index 6a0ad19..f085369 100644
@@ -508,7 +508,7 @@ static void __spu_add_to_rq(struct spu_context *ctx)
 		list_add_tail(&ctx->rq, &spu_prio->runq[ctx->prio]);
 		set_bit(ctx->prio, spu_prio->bitmap);
 		if (!spu_prio->nr_waiting++)
-			__mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK);
+			mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK);
 	}
 }
 
arch/x86/kernel/hpet.c +64 -16

176 lines not on this page · raw message

arch/x86/kernel/quirks.c +2 -1
index 309949e..697d1b7 100644
@@ -172,7 +172,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4,
 			 ich_force_enable_hpet);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7,
 			 ich_force_enable_hpet);
-
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x3a16,	/* ICH10 */
+			 ich_force_enable_hpet);
 
 static struct pci_dev *cached_dev;
 
drivers/infiniband/hw/ipath/ipath_driver.c +3 -3
index 69c0ce3..cb9daa6 100644
@@ -2715,7 +2715,7 @@ static void ipath_hol_signal_up(struct ipath_devdata *dd)
  * to prevent HoL blocking, then start the HoL timer that
  * periodically continues, then stop procs, so they can detect
  * link down if they want, and do something about it.
- * Timer may already be running, so use __mod_timer, not add_timer.
+ * Timer may already be running, so use mod_timer, not add_timer.
  */
 void ipath_hol_down(struct ipath_devdata *dd)
 {
@@ -2724,7 +2724,7 @@ void ipath_hol_down(struct ipath_devdata *dd)
 	dd->ipath_hol_next = IPATH_HOL_DOWNCONT;
 	dd->ipath_hol_timer.expires = jiffies +
 		msecs_to_jiffies(ipath_hol_timeout_ms);
-	__mod_timer(&dd->ipath_hol_timer, dd->ipath_hol_timer.expires);
+	mod_timer(&dd->ipath_hol_timer, dd->ipath_hol_timer.expires);
 }
 
 /*
@@ -2763,7 +2763,7 @@ void ipath_hol_event(unsigned long opaque)
 	else {
 		dd->ipath_hol_timer.expires = jiffies +
 			msecs_to_jiffies(ipath_hol_timeout_ms);
-		__mod_timer(&dd->ipath_hol_timer,
+		mod_timer(&dd->ipath_hol_timer,
 			dd->ipath_hol_timer.expires);
 	}
 }
include/linux/timer.h +2 -20
index daf9685..e2d662e 100644
@@ -86,8 +86,8 @@ static inline int timer_pending(const struct timer_list * timer)
 
 extern void add_timer_on(struct timer_list *timer, int cpu);
 extern int del_timer(struct timer_list * timer);
-extern int __mod_timer(struct timer_list *timer, unsigned long expires);
 extern int mod_timer(struct timer_list *timer, unsigned long expires);
+extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);
 
 /*
  * The jiffies value which is added to now, when there is no timer
@@ -146,25 +146,7 @@ static inline void timer_stats_timer_clear_start_info(struct timer_list *timer)
 }
 #endif
 
-/**
- * add_timer - start a timer
- * @timer: the timer to be added
- *
- * The kernel will do a ->function(->data) callback from the
- * timer interrupt at the ->expires point in the future. The
- * current time is 'jiffies'.
- *
- * The timer's ->expires, ->function (and if the handler uses it, ->data)
- * fields must be set prior calling this function.
- *
- * Timers with an ->expires field in the past will be executed in the next
- * timer tick.
- */
-static inline void add_timer(struct timer_list *timer)
-{
-	BUG_ON(timer_pending(timer));
-	__mod_timer(timer, timer->expires);
-}
+extern void add_timer(struct timer_list *timer);
 
 #ifdef CONFIG_SMP
   extern int try_to_del_timer_sync(struct timer_list *timer);
include/linux/timex.h +1 -1
index 998a55d..aa3475f 100644
@@ -190,7 +190,7 @@ struct timex {
  * offset and maximum frequency tolerance.
  */
 #define SHIFT_USEC 16		/* frequency offset scale (shift) */
-#define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))
+#define PPM_SCALE ((s64)NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))
 #define PPM_SCALE_INV_SHIFT 19
 #define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \
 		       PPM_SCALE + 1)
kernel/posix-cpu-timers.c +2 -1
index e976e50..8e5d9a6 100644
@@ -1370,7 +1370,8 @@ static inline int fastpath_timer_check(struct task_struct *tsk)
 		if (task_cputime_expired(&group_sample, &sig->cputime_expires))
 			return 1;
 	}
-	return 0;
+
+	return sig->rlim[RLIMIT_CPU].rlim_cur != RLIM_INFINITY;
 }
 
 /*
kernel/relay.c +1 -1
index 9d79b78..8f2179c 100644
@@ -750,7 +750,7 @@ size_t relay_switch_subbuf(struct rchan_buf *buf, size_t length)
 			 * from the scheduler (trying to re-grab
 			 * rq->lock), so defer it.
 			 */
-			__mod_timer(&buf->timer, jiffies + 1);
+			mod_timer(&buf->timer, jiffies + 1);
 	}
 
 	old = buf->data;
kernel/time/clockevents.c +11 -9
index ea2f48a..d13be21 100644
@@ -68,6 +68,17 @@ void clockevents_set_mode(struct clock_event_device *dev,
 	if (dev->mode != mode) {
 		dev->set_mode(mode, dev);
 		dev->mode = mode;
+
+		/*
+		 * A nsec2cyc multiplicator of 0 is invalid and we'd crash
+		 * on it, so fix it up and emit a warning:
+		 */
+		if (mode == CLOCK_EVT_MODE_ONESHOT) {
+			if (unlikely(!dev->mult)) {
+				dev->mult = 1;
+				WARN_ON(1);
+			}
+		}
 	}
 }
 
@@ -168,15 +179,6 @@ void clockevents_register_device(struct clock_event_device *dev)
 	BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
 	BUG_ON(!dev->cpumask);
 
-	/*
-	 * A nsec2cyc multiplicator of 0 is invalid and we'd crash
-	 * on it, so fix it up and emit a warning:
-	 */
-	if (unlikely(!dev->mult)) {
-		dev->mult = 1;
-		WARN_ON(1);
-	}
-
 	spin_lock(&clockevents_lock);
 
 	list_add(&dev->list, &clockevent_devices);
kernel/time/ntp.c +274 -170

578 lines not on this page · raw message

kernel/timer.c +73 -37

181 lines not on this page · raw message