public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Daniel Walker <dwalker@mvista.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix vsyscall settimeofday
Date: Mon, 05 Mar 2007 10:57:18 -0800	[thread overview]
Message-ID: <1173121038.31232.1.camel@localhost> (raw)
In-Reply-To: <20070305165648.518964015@mvista.com>

On Mon, 2007-03-05 at 08:56 -0800, Daniel Walker wrote:
> I've only seen this on x86_64 .
> 
> The vsyscall state only gets updated when a timer interrupts comes in . So
> if the time is set long before the next timer, there will be a period when
> a gettimeofday() won't reflect the correct time.
> 
> I added an explicit update_vsyscall() during the settimeofday(), that way
> the vsyscall state doesn't get stale.
> 
> Any thought John?

Oh! Yes, very good catch, Daniel!

Thanks so much!
-john


> Signed-Off-By: Daniel Walker <dwalker@mvista.com>

Acked-by: John Stultz <johnstul@us.ibm.com>


> ---
>  kernel/timer.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> Index: linux-2.6.20/kernel/timer.c
> ===================================================================
> --- linux-2.6.20.orig/kernel/timer.c
> +++ linux-2.6.20/kernel/timer.c
> @@ -861,6 +861,8 @@ int do_settimeofday(struct timespec *tv)
>  	clock->error = 0;
>  	ntp_clear();
> 
> +	update_vsyscall(&xtime, clock);
> +
>  	write_sequnlock_irqrestore(&xtime_lock, flags);
> 
>  	/* signal hrtimers about time change */


      reply	other threads:[~2007-03-05 18:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-05 16:56 [PATCH] fix vsyscall settimeofday Daniel Walker
2007-03-05 18:57 ` john stultz [this message]

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=1173121038.31232.1.camel@localhost \
    --to=johnstul@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox