mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: eli.carter@inet.com (Eli Carter)
Cc: lk@tantalophile.demon.co.uk (Jamie Lokier), linux-kernel@vger.kernel.org
Subject: Re: gettimeofday question
Date: Mon, 19 Mar 2001 23:44:06 +0000 (GMT)	[thread overview]
Message-ID: <200103192344.XAA02107@raistlin.arm.linux.org.uk> (raw)
In-Reply-To: <3AB68E13.E6F6109E@inet.com> from "Eli Carter" at Mar 19, 2001 04:54:11 PM

Eli Carter writes:
> And you described (in much better detail) the same problem I was talking
> about in the first email I sent today.

Ok, at least we've got the same picture that we're working from now.

> Yes, but it digs another to get the dirt to fill the first one. :/  for
> instance:
> 
> > 
> >         read_lock_xtime_and_ints();
> >         jiffies_1 = jiffies;
> >         counter_1 = counter;
> >         read_unlock_xtime_and_ints();
> 
> Time passes due to an interrupt handler.... but not a full jiffy, so
> jiffies hasn't changed.
> Also, what if this function is called with interrupts disabled?  (Is
> that legal?)  If so, we've broken the locking expected by the caller.

The calling function does indeed do the read_lock_xtime_and_ints() bit
for us.  However, we can always do a read_unlock(); sti(); read_lock_irq();
in do_gettimeofday().  Whether we want to or not is another matter,
especially as its not nice for a called function to explicitly enable
interrupts.

As for timer interrupts taking more than 10ms, yes, that is another
problem. ;(

> Comments?

This problem has a non-trivial solution, and I think whoever originally
wrote the x86 do_gettimeofday code decided that it wasn't worth finding
a solution to it.

--
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

  reply	other threads:[~2001-03-19 23:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-03 12:49 Russell King
2001-03-03 16:24 ` Russell King
2001-03-19  7:33 ` Russell King
2001-03-19 11:39   ` Jamie Lokier
2001-03-19 18:26     ` Eli Carter
2001-03-19 19:06       ` Russell King
2001-03-19 19:49         ` Eli Carter
2001-03-19 21:34           ` Russell King
2001-03-19 22:54             ` Eli Carter
2001-03-19 23:44               ` Russell King [this message]
2001-03-20 15:27                 ` Eli Carter
2001-03-21 22:14             ` Eli Carter
2001-03-21 22:27               ` Eli Carter
2001-03-21 23:10                 ` Eli Carter
2001-03-21 23:27               ` Question on binutils release to use Anthony Barbachan

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=200103192344.XAA02107@raistlin.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=eli.carter@inet.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lk@tantalophile.demon.co.uk \
    /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

all inboxes | Powered by JetHome®