All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] [PATCH] Use tsc for implementation of	clock_gettime.
Date: Thu, 17 May 2007 15:31:44 +0200	[thread overview]
Message-ID: <464C5940.2040406@domain.hid> (raw)
In-Reply-To: <17996.21557.378577.691298@domain.hid>

Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>  > Gilles Chanteperdrix wrote:
>  > > Jan Kiszka wrote:
>  > >  > Gilles Chanteperdrix wrote:
>  > >  > > Hi,
>  > >  > > 
>  > >  > > here comes, for review, a patch which reduces the overhead of
>  > >  > > clock_gettime by directly reading the tsc in user-space for
>  > >  > > architectures that support it.
>  > >  > 
>  > >  > Highly welcome. But I have one concern: How and when do you propagate
>  > >  > wallclock_offset changes to user space?
>  > > 
>  > > Since clock_settime is not implemented, never, but if clock_settime was
>  > > implemented, clock_settime would re-issue the __xn_sys_info syscall.
>  > 
>  > This excludes automatic clock adjustment, something I'm convinced we
>  > will have to provide in the future.
> 
> When we provide automatic clock adjustment, we will have to devise
> something more subtle than just an offset, so we will have to redesign

I think offset + scaling factor.

> posix clocks support anyway. Maybe clock_gettime(CLOCK_REALTIME) will
> then always be a syscall. After all, rt_timer_read is a syscall. If you
> want the fast clock, use CLOCK_MONOTONIC or rt_timer_tsc.

Actually, the issue of the intermediate approach starts earlier: as soon
as you have clock_settime. Then you need to sync the offset across
applications in different processes.

Having clock_monotonic (and maybe also rt_timer_tsc2ns) as a fast
variant already now is not bad. But beyond that, before introducing a
new interface between kernel and user space, I would like to consider
the effort to get it future-proof immediately. That doesn't mean that we
already have to implement clock adjustment, but we may already prepare
the prerequisites.

Jan


  reply	other threads:[~2007-05-17 13:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-17 11:29 [Xenomai-core] [PATCH] Use tsc for implementation of clock_gettime Gilles Chanteperdrix
2007-05-17 12:43 ` Jan Kiszka
2007-05-17 12:54   ` Gilles Chanteperdrix
2007-05-17 13:00     ` Jan Kiszka
2007-05-17 13:10       ` Gilles Chanteperdrix
2007-05-17 13:31         ` Jan Kiszka [this message]
2007-05-17 15:21           ` Gilles Chanteperdrix
2007-05-17 15:56             ` Gilles Chanteperdrix
2007-05-18  5:52               ` Jan Kiszka

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=464C5940.2040406@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.org \
    --cc=xenomai@xenomai.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.