All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Anzinger <george@wildturkeyranch.net>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@osdl.org>,
	LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Steven Rostedt <rostedt@goodmis.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 7/7] [hrtimers] Set correct initial expiry time for relative SIGEV_NONE timers
Date: Fri, 20 Jan 2006 08:33:07 -0800	[thread overview]
Message-ID: <43D110C3.6020604@wildturkeyranch.net> (raw)
In-Reply-To: <20060120021343.296071000@tglx.tec.linutronix.de>

Thomas Gleixner wrote:
> The expiry time for relative timers with SIGEV_NONE set was never
> updated to the correct value.
> 
> Pointed out by George Anzinger.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> 
> ---
> 
>  kernel/posix-timers.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> a1f15939b7af18c5abcd4810ccd512467c77a6b1
> diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
> index 28e72fd..e2fa4c0 100644
> --- a/kernel/posix-timers.c
> +++ b/kernel/posix-timers.c
> @@ -724,8 +724,13 @@ common_timer_set(struct k_itimer *timr, 
>  	timr->it.real.interval = timespec_to_ktime(new_setting->it_interval);
>  
>  	/* SIGEV_NONE timers are not queued ! See common_timer_get */
> -	if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE))
> +	if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) {
> +		/* Setup correct expiry time for relative timers */
> +		if (mode == HRTIMER_REL)
> +			timer->expires = ktime_add(timer-expires,
> +						   timer->base->get_time());
This is only part of the problem.  When the user does a timer_gettime() the 
expiry time is taken from the hrtimer field and NOT the posix-timer part. 
Somewhere this value needs to be copied to the hrtimer sub structure.

George
-- 

>  		return 0;
> +	}
>  
>  	hrtimer_start(timer, timer->expires, mode);
>  	return 0;

-- 
George Anzinger   george@wildturkeyranch.net
HRT (High-res-timers):  http://sourceforge.net/projects/high-res-timers/

  parent reply	other threads:[~2006-01-20 16:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-20  2:55 [PATCH 0/7] hrtimers updates Thomas Gleixner
2006-01-20  2:55 ` [PATCH 1/7] [hrtimers] Fixup itimer conversion Thomas Gleixner
2006-01-20  2:55 ` [PATCH 2/7] [hrtimers] Fix possible use of NULL pointer in posix-timers Thomas Gleixner
2006-01-20  2:55 ` [PATCH 3/7] [hrtimers] Fix oldvalue return in setitimer Thomas Gleixner
2006-01-24 21:56   ` Orion Poplawski
2006-01-25  6:56     ` Thomas Gleixner
2006-01-20  2:55 ` [PATCH 4/7] [hrtimers] Fix posix-timer requeue race Thomas Gleixner
2006-01-20 11:36   ` Roman Zippel
2006-01-20  2:55 ` [PATCH 5/7] [hrtimers] Cleanups and simplifications Thomas Gleixner
2006-01-20  2:55 ` [PATCH 6/7] [hrtimers] Add back lost credit lines Thomas Gleixner
2006-01-20  2:55 ` [PATCH 7/7] [hrtimers] Set correct initial expiry time for relative SIGEV_NONE timers Thomas Gleixner
2006-01-20  5:11   ` Andrew Morton
2006-01-20  9:49     ` Thomas Gleixner
2006-01-20 16:33   ` George Anzinger [this message]
2006-01-20 16:58     ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43D110C3.6020604@wildturkeyranch.net \
    --to=george@wildturkeyranch.net \
    --cc=akpm@osdl.org \
    --cc=george@mwildturkeyranch.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.