mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Cc: Nishanth Aravamudan <nacc@us.ibm.com>,
	joe.korty@ccur.com, george@mvista.com,
	inaky.perez-gonzalez@intel.com, linux-kernel@vger.kernel.org
Subject: Re: FW: [RFC] A more general timeout specification
Date: Mon, 22 Aug 2005 15:56:37 -0700	[thread overview]
Message-ID: <1124751398.22195.130.camel@cog.beaverton.ibm.com> (raw)
In-Reply-To: <17129.35821.291322.504723@sodium.jf.intel.com>

On Thu, 2005-07-28 at 18:52 -0700, Inaky Perez-Gonzalez wrote:
> The main user of this new inteface is to allow system calls to get
> time specified in an absolute form (as most of POSIX states) and thus
> avoid extra time conversion work.
> 
> There was a short thread about it, available at google groups
> (grepping for the subject).
> 
> http://groups-beta.google.com/groups?q=a+more+general+timeout+specification
> 
> Thanks!
> 
> [ for comment only ]
> 
> The fusyn (robust mutexes) project proposes the creation
> of a more general data structure, 'struct timeout', for the
> specification of timeouts in new services.  In this structure,
> the user specifies:
> 
>     a time, in timespec format.
>     the clock the time is specified against (eg, CLOCK_MONOTONIC).
>     whether the time is absolute, or relative to 'now'.
> 
> That is, all combinations of useful timeout attributes become
> possible.
> 
> Also proposed are two new kernel routines for the manipulation
> of timeouts:
> 
> 	timeout_validate()
> 	timeout_sleep()
> 
> timeout_validate() error-checks the syntax of a timeout
> argument and returns either zero or -EINVAL.  By breaking
> timeout_validate() out from timeout_sleep(), it becomes possible
> to error check the timeout 'far away' from the places in the
> code where we would actually do the timeout, as well as being
> able to perform such checks only at those places we know the
> timeout specification is coming from an unsafe source.
> 
> timeout_sleep() puts the caller to sleep until the
> specified end time is in the past, as measured against
> the given clock, or until the caller is awakened by other
> means (such as wake_up_process()).  Like schedule_timeout(),
> TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE must be set ahead
> of time; if TASK_INTERRUPTIBLE is set then signals will also
> break the caller out of the sleep.
> 
> timeout_sleep() returns either 0 (returned early) or -ETIMEDOUT
> (returned due to timeout).  It is up to the caller to resolve,
> in the "returned early" case, why it returned early.
> 
> Timeout_sleep has a return argument, endtime, which is also in
> 'struct timeout' format.  If the input time was relative, then
> it is converted to absolute and returned through this argument.
> This can be used when an early-terminated service must be
> restarted and side effects of the early termination-n-restart
> (such as end time drift) are to be avoided.


Hey Inaky, Joe,

	Sorry for the terribly slow response. I haven't really dealt too much
with the user-space interfaces for the posix clocks and timers, so I'm
no authority on it. Being able to use absolute values does seem very
important to me, as well as avoiding having glibc make the conversion
using gettimeofday() so that part looks good. I'm not completely sold on
why the validate interface is needed, but I didn't hear any objections
from George, so I'd defer to those who deal more with those interfaces.


Sorry for the lack of insight, although since I haven't heard much on
this recently, maybe this will help stir up the debate?

Nish, do you have any comments on this idea?

thanks
-john



  reply	other threads:[~2005-08-22 22:56 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-18 20:15 Joe Korty
2005-05-18 22:15 ` Inaky Perez-Gonzalez
2005-05-19 13:39   ` Joe Korty
2005-05-18 23:49 ` Andi Kleen
2005-05-19 13:24   ` Joe Korty
2005-05-19 17:02   ` George Anzinger
2005-05-19 18:35     ` Inaky Perez-Gonzalez
2005-05-20 19:05     ` Andi Kleen
2005-05-21  1:12       ` George Anzinger
2005-07-29  1:52 ` FW: " Inaky Perez-Gonzalez
2005-08-22 22:56   ` john stultz [this message]
2005-08-23  1:13 Perez-Gonzalez, Inaky
2005-08-31 20:55 Perez-Gonzalez, Inaky
2005-08-31 21:15 ` Joe Korty
2005-08-31 21:20 ` Christopher Friesen
2005-08-31 21:34   ` Joe Korty
2005-08-31 22:06     ` Christopher Friesen
2005-08-31 22:10 ` Roman Zippel
2005-08-31 22:11 Perez-Gonzalez, Inaky
2005-08-31 23:06 ` Christopher Friesen
2005-08-31 22:15 Perez-Gonzalez, Inaky
2005-08-31 23:01 ` Roman Zippel
2005-08-31 23:17 Perez-Gonzalez, Inaky
2005-08-31 23:24 Perez-Gonzalez, Inaky
2005-08-31 23:50 ` Roman Zippel
2005-09-01  0:08   ` Daniel Walker
2005-09-01  9:22     ` Roman Zippel
2005-09-01 13:53       ` Joe Korty
2005-09-01 13:50   ` Joe Korty
2005-09-01 14:32     ` Roman Zippel
2005-09-01 15:10       ` Daniel Walker
2005-09-01 15:11       ` Daniel Walker
2005-09-01 15:47       ` Joe Korty
2005-09-01  0:00 Perez-Gonzalez, Inaky
2005-09-01  9:19 ` Roman Zippel
2005-09-01 13:48   ` Joe Korty
2005-09-01 15:18     ` Roman Zippel
2005-09-01 11:59 Perez-Gonzalez, Inaky
2005-09-01 12:55 ` Roman Zippel

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=1124751398.22195.130.camel@cog.beaverton.ibm.com \
    --to=johnstul@us.ibm.com \
    --cc=george@mvista.com \
    --cc=inaky.perez-gonzalez@intel.com \
    --cc=inaky@linux.intel.com \
    --cc=joe.korty@ccur.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nacc@us.ibm.com \
    /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®