signal c/r: don't play with zero timeouts
PATCH 1/1 signal c/r: don't play with zero timeouts
If it_virt_expires or it_prof_expires is zero, then don't subtract {virt,prof}_ticks(t) from it. This is the same thing do_getitimer() does, and it fixes my issues with the signals c/r patchset on s390.
Signed-off-by Serge E. Hallyn <serue-r/[email protected]>
--- checkpoint/signal.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
checkpoint/signal.c +6 -2
@@ -382,13 +382,17 @@ static int checkpoint_signal(struct ckpt_ctx *ctx, struct task_struct *t) } h->it_real_incr =ktime_to_ns (signal->it_real_incr); - cputime =cputime_sub (signal->it_virt_expires,virt_ticks (t)); + cputime = signal->it_virt_expires; +if (!cputime_eq (cputime, cputime_zero)) + cputime =cputime_sub (signal->it_virt_expires,virt_ticks (t));cputime_to_timeval (cputime, &tval); h->it_virt_value =timeval_to_ns (&tval);cputime_to_timeval (signal->it_virt_incr, &tval); h->it_virt_incr =timeval_to_ns (&tval); - cputime =cputime_sub (signal->it_prof_expires,prof_ticks (t)); + cputime = signal->it_prof_expires; +if (!cputime_eq (cputime, cputime_zero)) + cputime =cputime_sub (signal->it_prof_expires,prof_ticks (t));cputime_to_timeval (cputime, &tval); h->it_prof_value =timeval_to_ns (&tval);cputime_to_timeval (signal->it_prof_incr, &tval);
Signature · 1 line
1.6.1
A message that is not in the archive (sent off-list or not yet received): 20090827184934.GA20580-r/[email protected]
Yep. Pushed...
Quoted 34 lines · Serge E. Hallyn
If
it_virt_expiresorit_prof_expiresis zero, then don't subtract {virt,prof}_ticks(t) from it. This is the same thingdo_getitimer()does, and it fixes my issues with the signals c/r patchset on s390.Signed-off-by Serge E. Hallyn <serue-r/[email protected]>--- checkpoint/signal.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)checkpoint/signal.c +6
-2@@ -382,13 +382,17 @@ static int checkpoint_signal(struct ckpt_ctx *ctx, struct task_struct *t) } h->it_real_incr =ktime_to_ns (signal->it_real_incr); - cputime =cputime_sub (signal->it_virt_expires,virt_ticks (t)); + cputime = signal->it_virt_expires; +if (!cputime_eq (cputime, cputime_zero)) + cputime =cputime_sub (signal->it_virt_expires,virt_ticks (t));cputime_to_timeval (cputime, &tval); h->it_virt_value =timeval_to_ns (&tval);cputime_to_timeval (signal->it_virt_incr, &tval); h->it_virt_incr =timeval_to_ns (&tval); - cputime =cputime_sub (signal->it_prof_expires,prof_ticks (t)); + cputime = signal->it_prof_expires; +if (!cputime_eq (cputime, cputime_zero)) + cputime =cputime_sub (signal->it_prof_expires,prof_ticks (t));cputime_to_timeval (cputime, &tval); h->it_prof_value =timeval_to_ns (&tval);cputime_to_timeval (signal->it_prof_incr, &tval);