Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.hardware > #2397

Re: Realtime clock accessible without context-switch?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Clemens Ladisch <clemens@ladisch.de>
Newsgroups comp.os.linux.misc, comp.os.linux.hardware
Subject Re: Realtime clock accessible without context-switch?
Date Thu, 22 May 2014 20:36:04 +0200
Lines 25
Message-ID <bu6udeF1cbuU1@mid.individual.net> (permalink)
References <llfapk$mhc$2@dont-email.me> <bu1qcoFt9amU1@mid.individual.net> <llhkkb$56l$1@dont-email.me> <bu46amFe2ebU1@mid.individual.net> <wwvegzm4v6d.fsf@l1AntVDjLrnP7Td3DQJ8ynzIq3lJMueXf87AxnpFoA.invalid> <llkadb$s96$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace individual.net Mpp6ZLYGjo9E4KL51qAA+gZoZfvrNUxISjMfoAupm2T68RKNXU
Cancel-Lock sha1:3cNRpyKsqcm+NgqPSG2+kbl7q/Q=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
In-Reply-To <llkadb$s96$1@dont-email.me>
Xref csiph.com comp.os.linux.misc:11117 comp.os.linux.hardware:2397

Cross-posted to 2 groups.

Show key headers only | View raw


Charles T. Smith wrote:
> On Wed, 21 May 2014 23:35:22 +0100, Richard Kettlewell wrote:
>> Clemens Ladisch <clemens@ladisch.de> writes:
>>> An I/O access (about one microsecond) is much slower than the SYSCALL
>>> instruction; and with the RTC, you'd need to read several registers.
>>
>> As it happens, fetching the current time doesn’t involve a syscall
>> anyway (on amd64).

Yeah; the kernel reads the realtime clock once when booting, and then
tries to avoid touching it ever again by using another clock to track
the current time.

> And I'm reasonably sure that doing a task switch on linux has much more
> involved in it than just the trap instruction itself.

On AMD64, a system call does not involve a trap; it's just a jump to
a predefined address that also switches the privilege level so that
the kernel code is allowed to access all memory pages.  A task switch
has to save and restore all registers, and to switch page tables if
the new task is in another process.


Regards,
Clemens

Back to comp.os.linux.hardware | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Realtime clock accessible without context-switch? "Charles T. Smith" <cts.private.yahoo@gmail.com> - 2014-05-20 10:29 +0000
  Re: Realtime clock accessible without context-switch? Clemens Ladisch <clemens@ladisch.de> - 2014-05-20 21:56 +0200
    Re: Realtime clock accessible without context-switch? "Charles T. Smith" <cts.private.yahoo@gmail.com> - 2014-05-21 07:29 +0000
      Re: Realtime clock accessible without context-switch? Thomas Richter <thor@math.tu-berlin.de> - 2014-05-21 09:47 +0200
      Re: Realtime clock accessible without context-switch? William Unruh <unruh@invalid.ca> - 2014-05-21 15:51 +0000
      Re: Realtime clock accessible without context-switch? Clemens Ladisch <clemens@ladisch.de> - 2014-05-21 19:32 +0200
        Re: Realtime clock accessible without context-switch? Richard Kettlewell <rjk@greenend.org.uk> - 2014-05-21 23:35 +0100
          Re: Realtime clock accessible without context-switch? "Charles T. Smith" <cts.private.yahoo@gmail.com> - 2014-05-22 07:53 +0000
            Re: Realtime clock accessible without context-switch? Clemens Ladisch <clemens@ladisch.de> - 2014-05-22 20:36 +0200
              Re: Realtime clock accessible without context-switch? Richard Kettlewell <rjk@greenend.org.uk> - 2014-05-22 20:26 +0100
                Re: Realtime clock accessible without context-switch? William Unruh <unruh@invalid.ca> - 2014-05-22 22:48 +0000
        Re: Realtime clock accessible without context-switch? Jan Pieter <jp@jp.dhs.orig> - 2014-06-01 09:58 +0200
  Re: Realtime clock accessible without context-switch? Todd <Todd@invalid.invalid> - 2014-05-23 14:20 -0700

csiph-web