public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT Pull] timer fixes for 2.6.35-rc1
@ 2010-05-24  9:54 Thomas Gleixner
  2010-05-24 10:15 ` [GIT Pull V2] " Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2010-05-24  9:54 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, LKML, Ingo Molnar

Linus,

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

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

Thanks,

	tglx

------------------>
Thomas Gleixner (1):
      timekeeping: Fix timezone update


 kernel/time.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/time.c b/kernel/time.c
index 50612fa..848b1c2 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -132,10 +132,10 @@ SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv,
  */
 static inline void warp_clock(void)
 {
-	struct timespec delta, adjust;
-	delta.tv_sec = sys_tz.tz_minuteswest * 60;
-	delta.tv_nsec = 0;
-	adjust = timespec_add_safe(current_kernel_time(), delta);
+	struct timespec adjust;
+
+	adjust = current_kernel_time();
+	adjust.tv_sec += sys_tz.tz_minuteswest * 60;
 	do_settimeofday(&adjust);
 }
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [GIT Pull V2] timer fixes for 2.6.35-rc1
  2010-05-24  9:54 [GIT Pull] timer fixes for 2.6.35-rc1 Thomas Gleixner
@ 2010-05-24 10:15 ` Thomas Gleixner
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2010-05-24 10:15 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, LKML, Ingo Molnar

Linus,

please discard the previous pull and take this one. I missed the timer
fix in the first place.


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

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

Thanks,

	tglx


------------------>
Jeff Chua (1):
      timers: Fix slack calculation for expired timers

Thomas Gleixner (1):
      timekeeping: Fix timezone update


 kernel/time.c  |    8 ++++----
 kernel/timer.c |    7 ++++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/kernel/time.c b/kernel/time.c
index 50612fa..848b1c2 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -132,10 +132,10 @@ SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv,
  */
 static inline void warp_clock(void)
 {
-	struct timespec delta, adjust;
-	delta.tv_sec = sys_tz.tz_minuteswest * 60;
-	delta.tv_nsec = 0;
-	adjust = timespec_add_safe(current_kernel_time(), delta);
+	struct timespec adjust;
+
+	adjust = current_kernel_time();
+	adjust.tv_sec += sys_tz.tz_minuteswest * 60;
 	do_settimeofday(&adjust);
 }
 
diff --git a/kernel/timer.c b/kernel/timer.c
index 9199f3c..be394af 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -750,13 +750,14 @@ unsigned long apply_slack(struct timer_list *timer, unsigned long expires)
 	unsigned long expires_limit, mask;
 	int bit;
 
-	expires_limit = expires + timer->slack;
+	expires_limit = expires;
 
-	if (timer->slack < 0) /* auto slack: use 0.4% */
+	if (timer->slack > -1)
+		expires_limit = expires + timer->slack;
+	else if (time_after(expires, jiffies)) /* auto slack: use 0.4% */
 		expires_limit = expires + (expires - jiffies)/256;
 
 	mask = expires ^ expires_limit;
-
 	if (mask == 0)
 		return expires;
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [GIT pull] timer fixes for 2.6.35-rc1
@ 2010-05-28  9:07 Thomas Gleixner
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2010-05-28  9:07 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, LKML, Ingo Molnar

Linus,

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

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

Thanks,

	tglx

------------------>
Andrey Vagin (1):
      posix_timer: Fix error path in timer_create

Stanislaw Gruszka (1):
      hrtimer: Avoid double seqlock

Thomas Gleixner (2):
      timers: Fix slack calculation really
      timers: Move local variable into else section


 kernel/hrtimer.c      |    2 +-
 kernel/posix-timers.c |   11 ++++-------
 kernel/timer.c        |   10 +++++++---
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index b9b134b..5c69e99 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -89,7 +89,7 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
 
 	do {
 		seq = read_seqbegin(&xtime_lock);
-		xts = current_kernel_time();
+		xts = __current_kernel_time();
 		tom = wall_to_monotonic;
 	} while (read_seqretry(&xtime_lock, seq));
 
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 00d1fda..ad72342 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -559,14 +559,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
 	new_timer->it_id = (timer_t) new_timer_id;
 	new_timer->it_clock = which_clock;
 	new_timer->it_overrun = -1;
-	error = CLOCK_DISPATCH(which_clock, timer_create, (new_timer));
-	if (error)
-		goto out;
 
-	/*
-	 * return the timer_id now.  The next step is hard to
-	 * back out if there is an error.
-	 */
 	if (copy_to_user(created_timer_id,
 			 &new_timer_id, sizeof (new_timer_id))) {
 		error = -EFAULT;
@@ -597,6 +590,10 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
 	new_timer->sigq->info.si_tid   = new_timer->it_id;
 	new_timer->sigq->info.si_code  = SI_TIMER;
 
+	error = CLOCK_DISPATCH(which_clock, timer_create, (new_timer));
+	if (error)
+		goto out;
+
 	spin_lock_irq(&current->sighand->siglock);
 	new_timer->it_signal = current->signal;
 	list_add(&new_timer->list, &current->signal->posix_timers);
diff --git a/kernel/timer.c b/kernel/timer.c
index be394af..2211834 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -752,11 +752,15 @@ unsigned long apply_slack(struct timer_list *timer, unsigned long expires)
 
 	expires_limit = expires;
 
-	if (timer->slack > -1)
+	if (timer->slack >= 0) {
 		expires_limit = expires + timer->slack;
-	else if (time_after(expires, jiffies)) /* auto slack: use 0.4% */
-		expires_limit = expires + (expires - jiffies)/256;
+	} else {
+		unsigned long now = jiffies;
 
+		/* No slack, if already expired else auto slack 0.4% */
+		if (time_after(expires, now))
+			expires_limit = expires + (expires - now)/256;
+	}
 	mask = expires ^ expires_limit;
 	if (mask == 0)
 		return expires;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-28  9:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-24  9:54 [GIT Pull] timer fixes for 2.6.35-rc1 Thomas Gleixner
2010-05-24 10:15 ` [GIT Pull V2] " Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2010-05-28  9:07 [GIT pull] " Thomas Gleixner

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