2006-01-20 02:55:40

by Thomas Gleixner

[permalink] [raw]
Subject: [PATCH 3/7] [hrtimers] Fix oldvalue return in setitimer


This resolves bugzilla bug#5617. The oldvalue of the
timer was read after the timer was cancelled, so the
remaining time was always zero.

Signed-off-by: Thomas Gleixner <[email protected]>

---

kernel/itimer.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)

3f59dd20898d805781b3eac7ed0807e7a0b30f2f
diff --git a/kernel/itimer.c b/kernel/itimer.c
index 6433d06..379be2f 100644
--- a/kernel/itimer.c
+++ b/kernel/itimer.c
@@ -155,16 +155,16 @@ int do_setitimer(int which, struct itime
again:
spin_lock_irq(&tsk->sighand->siglock);
timer = &tsk->signal->real_timer;
- /* We are sharing ->siglock with it_real_fn() */
- if (hrtimer_try_to_cancel(timer) < 0) {
- spin_unlock_irq(&tsk->sighand->siglock);
- goto again;
- }
if (ovalue) {
ovalue->it_value = itimer_get_remtime(timer);
ovalue->it_interval
= ktime_to_timeval(tsk->signal->it_real_incr);
}
+ /* We are sharing ->siglock with it_real_fn() */
+ if (hrtimer_try_to_cancel(timer) < 0) {
+ spin_unlock_irq(&tsk->sighand->siglock);
+ goto again;
+ }
tsk->signal->it_real_incr =
timeval_to_ktime(value->it_interval);
expires = timeval_to_ktime(value->it_value);
--
1.0.8

--


2006-01-24 21:56:39

by Orion Poplawski

[permalink] [raw]
Subject: Re: [PATCH 3/7] [hrtimers] Fix oldvalue return in setitimer

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas Gleixner wrote:
> This resolves bugzilla bug#5617. The oldvalue of the
> timer was read after the timer was cancelled, so the
> remaining time was always zero.
>

I'm seeing this problem on recent Fedore development kernels.
Interestingly, it causes the IDL 7 minute timed demo to exit immediately
upon trying to plot since it resets the timer and expects the old value
to be returned.

- - Orion
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFD1qJyORnzrtFC2/sRAnp4AJ9ZQ/E0huj2sk8TOxF/1QF7OnrtQQCdHwsT
g0YGeKL3Co9isimpQJ8f3mU=
=R+Z4
-----END PGP SIGNATURE-----

2006-01-25 06:55:42

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 3/7] [hrtimers] Fix oldvalue return in setitimer

On Tue, 2006-01-24 at 14:56 -0700, Orion Poplawski wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thomas Gleixner wrote:
> > This resolves bugzilla bug#5617. The oldvalue of the
> > timer was read after the timer was cancelled, so the
> > remaining time was always zero.
> >
>
> I'm seeing this problem on recent Fedore development kernels.
> Interestingly, it causes the IDL 7 minute timed demo to exit immediately
> upon trying to plot since it resets the timer and expects the old value
> to be returned.

Thats the same problem.

tglx