public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC][UPDATE PATCH 2/4] convert soft-timer subsystem to timerintervals
Date: Wed, 18 May 2005 10:00:39 -0700	[thread overview]
Message-ID: <20050518170039.GD4205@us.ibm.com> (raw)
In-Reply-To: <20050518155927.8751.qmail@lwn.net>

On 18.05.2005 [09:59:27 -0600], Jonathan Corbet wrote:
> Hi, Nishanth,
> 
> To my uneducated eye, this patch looks like a useful cleaning-up of the
> timer API.  I do have one question, though...

Thanks! I think one of the best side-effects (beyond a more accurate
execution of sleep requests) of my patch is that the new interfaces are
a heck of a lot saner :)

> > @@ -238,15 +327,41 @@ void add_timer_on(struct timer_list *tim
> >  	check_timer(timer);
> >  
> >  	spin_lock_irqsave(&base->lock, flags);
> > +	timer->expires = jiffies_to_timerintervals(timer->expires);
> 
> It would appear that, depending on where you are, ->expires can be
> expressed in two different units.  Users of add_timer() and mod_timer()
> are expecting jiffies, but the internal code uses timer intervals.  What
> happens when somebody does something like this?
> 
> 	mod_timer(&my_timer, my_timer.expires + additional_delay);
> 
> Might it be better to store the timerintervals value in a different
> field, and leave ->expires as part of the legacy interface only?

This is definitely an option. Currently, it is somewhat vague as to
whether, once a timer has been submitted, whether the expires field is
still valid to the caller. In the new system, it will clearly explicitly
not be (I meant to modify the comment to add_timer(), mod_timer() and
set_timer_nsecs() appropriately, but have not yet.

The problem with the mod_timer() approach you suggest is that there is
no guarantee that my_timer.expires represents anything close to the
current time. And, as far as my experience with reviewing the current
callers is concerned, there is no such usage.

It definitely is feasible and reasonable, though, to make that change. I
will look into it and see what I can do.

Thanks for the feedback!

-Nish

  reply	other threads:[~2005-05-18 17:03 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-14  0:16 [RFC][PATCH (1/7)] new timeofday subsystem (v A5) john stultz
2005-05-14  0:17 ` [RFC][PATCH (2/7)] new timeofday i386 arch specific changes " john stultz
2005-05-14  0:19   ` [RFC][PATCH (3/7)] new timeofday x86-64 " john stultz
2005-05-14  0:20     ` [RFC][PATCH (4/7)] new timeofday i386 and x86-64 timesources " john stultz
2005-05-14  0:22       ` [RFC][PATCH (5/7)] new timeofday ia64,ppc32,ppc64 and s390 arch specific hooks " john stultz
2005-05-14  0:23         ` [RFC][PATCH (6/7)] new timeofday ia64,ppc32,ppc64 and s390 timesources " john stultz
2005-05-14  0:27           ` [RFC][PATCH (7/7)] new timeofday i386 vsyscall proof of concept " john stultz
2005-05-16 21:53             ` john stultz
2005-05-14 19:55         ` IA64 implementation of timesource for new time of day subsystem Christoph Lameter
2005-05-15 10:22           ` James Courtier-Dutton
2005-05-15 10:17             ` Andi Kleen
2005-05-16 15:30               ` Chris Friesen
2005-05-16 17:34           ` john stultz
2005-05-16 18:09             ` Christoph Lameter
2005-05-16 18:45               ` john stultz
2005-05-16 18:55                 ` john stultz
2005-05-16 19:24                 ` Christoph Lameter
2005-05-16 19:29                   ` David Mosberger
2005-05-16 19:50                     ` john stultz
2005-05-16 20:27                       ` Christoph Lameter
2005-05-16 20:53                         ` john stultz
2005-05-16 20:58                           ` David Mosberger
2005-05-16 21:35                             ` john stultz
2005-05-16 21:53                               ` Christoph Lameter
2005-05-17  8:05                     ` Ulrich Windl
2005-05-16 18:52     ` [RFC][PATCH (3/7)] new timeofday x86-64 specific changes (v A5) john stultz
2005-05-17 23:33 ` [RFC][PATCH 0/4] new timeofday-based soft-timer subsystem Nishanth Aravamudan
2005-05-17 23:34   ` [RFC][PATCH 1/4] move arch-specific timeofday core to asm Nishanth Aravamudan
2005-05-17 23:36   ` [RFC][PATCH 2/4] convert soft-timer subsystem to timerintervals Nishanth Aravamudan
2005-05-18  8:21     ` [RFC][UPDATE PATCH " Nishanth Aravamudan
2005-05-18 15:59       ` Jonathan Corbet
2005-05-18 17:00         ` Nishanth Aravamudan [this message]
2005-05-17 23:37   ` [RFC][PATCH 3/4] convert sys_nanosleep() to use new soft-timer subsystem Nishanth Aravamudan
2005-05-17 23:38   ` [RFC][PATCH 4/4] support new soft-timer subsystem on non-NEWTOD archs Nishanth Aravamudan
2005-05-19 23:29   ` [RFC][PATCH 0/4] new timeofday-based soft-timer subsystem Nishanth Aravamudan

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=20050518170039.GD4205@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=corbet@lwn.net \
    --cc=linux-kernel@vger.kernel.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