mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Darren Hart <dvhltc@us.ibm.com>, Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andreas Schwab <schwab@redhat.com>, Danny Feng <dfeng@redhat.com>,
	Jakub Jelinek <jakub@redhat.com>,
	linux-kernel@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>
Subject: Re: Q: sys_futex() && timespec_valid()
Date: Fri, 25 Jun 2010 22:25:31 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1006252212420.18683@localhost.localdomain> (raw)
In-Reply-To: <235959492.961541277496281970.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>

On Fri, 25 Jun 2010, Ulrich Drepper wrote:

> ----- "Thomas Gleixner" <tglx@linutronix.de> wrote:
> > tv->sec < 0 is definitely an invalid value for both CLOCK_REALTIME
> > and CLOCK_MONOTONIC.

> CLOCK_MONOTONIC is different but it's wrong for CLOCK_REALTIME.

Why is CLOCK_MONOTONIC any different ? According to you argumentation
it's just _BEFORE_ we started the system.

> Why would it be invalid?  Because times before Epoch will not be
> used?  By that logic you would have to declare all values before
> Linus' first running kernel as invalid.  None of this makes sense.

That's utter bullshit and you know that. Every system which does not
have an RTC starts with the EPOCH and the range check is correct in
the terms of the specification:

    Outside the valid range of the clock_id.

The kernel treats the range valid which it can theoretically hand back
to user space:

   EPOCH <= CLOCK_REALTIME <= Y2038_or_far_away

   0 <= CLOCK_MONOTONIC <= far_away

> The tv_sec in timespec is of type time_t and for absolute time
> values the same semantics as for naked time_t values applies.  The
> absolute time is
>   epoch + tv_sec + tv_nsec / 1000000000
> 
> If tv_sec is negative these are values before epoch.
> 
> If there are other interfaces with absolute timeouts they certainly
>  should be changed as well.

If we'd change that, then we'd need to allow negative relative
timeouts as well and not restrict it to CLOCK_REALTIME. 

If we'd change the notion of "valid" then we do it in a consistent
way for everything not just for a corner case of some glibc wreckage.

Thanks,

	tglx

  reply	other threads:[~2010-06-25 20:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-25 19:20 Oleg Nesterov
2010-06-25 19:42 ` Darren Hart
2010-06-25 19:49   ` Ulrich Drepper
2010-06-25 20:11     ` Thomas Gleixner
2010-06-28 13:58     ` Oleg Nesterov
2010-06-28 14:37       ` Jakub Jelinek
2010-06-28 15:02         ` Oleg Nesterov
2010-06-25 19:56   ` Mathieu Desnoyers
2010-06-25 19:59 ` Thomas Gleixner
2010-06-25 20:04   ` Ulrich Drepper
2010-06-25 20:25     ` Thomas Gleixner [this message]
2010-06-28 15:15     ` Linus Torvalds
2010-06-28 15:29       ` Andreas Schwab
2010-06-28 15:33         ` Thomas Gleixner
2010-06-28 16:04         ` Linus Torvalds

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=alpine.LFD.2.00.1006252212420.18683@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=dfeng@redhat.com \
    --cc=drepper@redhat.com \
    --cc=dvhltc@us.ibm.com \
    --cc=jakub@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=schwab@redhat.com \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®