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,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Oleg Nesterov <oleg@redhat.com>
Subject: Re: Q: sys_futex() && timespec_valid()
Date: Fri, 25 Jun 2010 22:11:19 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.1006252159370.18683@localhost.localdomain> (raw)
In-Reply-To: <2054433814.959851277495348646.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
On Fri, 25 Jun 2010, Ulrich Drepper wrote:
Can you please use a mail client with proper line breaks ?
> ----- "Darren Hart" <dvhltc@us.ibm.com> wrote:
> > Unless there is some good reason to object to breaking the API that I
> > am missing, I don't mind changing it to -ETIMEDOUT (although -EINVAL
> > seems more intuitive to me).
>
> It's only not intuitive because Oleg misrepresented or at least
> didn't describe the issue.
> The kernel already catches invalid timespec values. Unfortunately
> the code used comes from the time when all timeouts where specified
> with relative values. In such situations negative tv_sec values
> were in fact invalid and rejected with EINVAL.
> But for absolute timeouts tv_sec = -1 means a time before Epoch.
> This is not an invalid value, it just is one of many points in time
> which have passed and therefore the kernel has to respond with
> ETIMEDOUT.
That's simply wrong.
... or the TIMER_ABSTIME flag was specified in flags and the rqtp
argument is outside the range for the clock specified by clock_id;
And I consider anything before the EPOCH or before the computer booted
outside of the range. Simply because that's outside the range which we
can read back from the clock, out of the range to which we can set the
clock.
And it's completely illogical to treat relative and abolute timeouts
different. If we'd accept that before the EPOCH or before the computer
started is valid for ABSTIME, then there is no freaking reason to
treat relative timeouts any different.
> This is no semantic change or anything like that. It pure and
> simply a bug fix. When Thomas worked on that come we simply missed
> updating the test for invalid timespec values.
No, that's how we treat every damned timespec in the
syscalls. clock_nanosleep(ABSTIME) has this behaviour forever and we
have this behaviour in sys_futex since we merged PI futex support way
before we added the BITSET stuff.
So just because you messed up your glibc implementation you want us to
fix glibc in the kernel based on some backwards arguments ?
> The kernel code should be fixed to always check tv_nsec for < 0 and
> > 1000000000. But the tv_sec test for < 0 should be skipped if the
> timeout value is interpreted as an absolute time value.
Definitely NOT!
tglx
next prev parent reply other threads:[~2010-06-25 20:11 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 [this message]
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
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.1006252159370.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=mathieu.desnoyers@efficios.com \
--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®