[Devel] Re: [PATCH 1/1] signal c/r: don't play with zero timeouts

Oren Laadan orenl at librato.com
Fri Aug 28 08:21:57 PDT 2009


Yep. Pushed...

Serge E. Hallyn wrote:
> 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 at us.ibm.com>
> ---
>  checkpoint/signal.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/checkpoint/signal.c b/checkpoint/signal.c
> index 960356c..15b7cdc 100644
> --- a/checkpoint/signal.c
> +++ b/checkpoint/signal.c
> @@ -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);
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list