mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Hellwig <hch@lst.de>, Tejun Heo <tj@kernel.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Mark Gross <mark.gross@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-s390 <linux-s390@vger.kernel.org>
Subject: Re: RFC: better timer interface
Date: Sun, 21 May 2017 20:14:45 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1705211959370.3023@nanos> (raw)
In-Reply-To: <alpine.DEB.2.20.1705211859410.3023@nanos>

On Sun, 21 May 2017, Thomas Gleixner wrote:
> On Tue, 16 May 2017, Arnd Bergmann wrote:
> > On Tue, May 16, 2017 at 5:51 PM, Christoph Hellwig <hch@lst.de> wrote:
> > > Yes, that sounds useful to me as well.  As you said it's an independent
> > > but somewhat related change.  I can add it to my series, but I'll
> > > need a suggestions for a good and short name.  That already was the
> > > hardest part for the setup side :)
> > 
> > If we keep the unusual *_timer() naming (rather than timer_*() as hrtimer
> > has), we could use one of
> > 
> > a) start_timer(struct timer_list *timer, unsigned long ms);
> > b) restart_timer(struct timer_list *timer, unsigned long ms);
> > c) mod_timer_ms(struct timer_list *timer, unsigned long ms);
> >     mod_timer_sec(struct timer_list *timer, unsigned long sec);
> 
> Please make new functions prefixed with timer_ and get rid of that old
> interface completely. It's horrible.
>  
> timer_init()
> timer_start(timer, ms, abs)

I'm not even sure, whether we need absolute timer wheel timers at
all, because most use cases are relative to now.

But it's easy enough to provide them. All we need for that is something
like

	unsigned long time_msec;	

which gets incremented every tick by the appropriate amount of
milliseconds.

Having that would also allow to replace all the

       end = jiffies + msec_to_jiffies(xxx);

       while (time_before(jiffies, end))
       	     ....

constructs with a milliseconds based machinery. So we can remove all
*_to_jiffies() interfaces over time.

Thanks,

	tglx

  reply	other threads:[~2017-05-21 18:15 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 11:48 Christoph Hellwig
2017-05-16 11:48 ` [PATCH 1/9] timers: remove the fn and data arguments to call_timer_fn Christoph Hellwig
2017-05-16 11:48 ` [PATCH 2/9] timers: provide a "modern" variant of timers Christoph Hellwig
2017-05-16 19:29   ` Randy Dunlap
2017-05-16 20:03   ` Arnd Bergmann
2017-05-18  8:24     ` Christoph Hellwig
2017-05-18  8:41       ` Christoph Hellwig
2017-05-18  8:57         ` Arnd Bergmann
2017-05-21  7:00           ` Christoph Hellwig
2017-05-21 12:29             ` Arnd Bergmann
2017-05-21 17:57         ` Thomas Gleixner
2017-05-21 18:23           ` Al Viro
2017-05-19 10:48   ` David Laight
2017-05-21  6:57     ` 'Christoph Hellwig'
2017-05-16 11:48 ` [PATCH 3/9] kthread: remove unused macros Christoph Hellwig
2017-05-17 12:09   ` Petr Mladek
2017-05-18  8:22     ` Christoph Hellwig
2017-05-16 11:48 ` [PATCH 4/9] workqueue: switch to modern timers Christoph Hellwig
2017-05-16 11:48 ` [PATCH 5/9] powerpc/numa: switch topology_timer to modern timer Christoph Hellwig
2017-05-16 11:48 ` [PATCH 6/9] s390: switch topology_timer to a " Christoph Hellwig
2017-05-16 11:48 ` [PATCH 7/9] s390: switch lgr timer " Christoph Hellwig
2017-05-16 11:48 ` [PATCH 8/9] tlclk: switch switchover_timer " Christoph Hellwig
2017-05-16 11:48 ` [PATCH 9/9] timers: remove old timer initialization macros Christoph Hellwig
2017-05-16 19:43   ` Arnd Bergmann
2017-05-18  8:25     ` Christoph Hellwig
2017-05-16 15:45 ` RFC: better timer interface Arnd Bergmann
2017-05-16 15:51   ` Christoph Hellwig
2017-05-16 20:26     ` Arnd Bergmann
2017-05-18  8:27       ` Christoph Hellwig
2017-05-21 17:13       ` Thomas Gleixner
2017-05-21 18:14         ` Thomas Gleixner [this message]
2017-05-22 11:26           ` Arnd Bergmann
2017-05-22 19:24             ` Thomas Gleixner
2017-05-23 11:36           ` David Laight
2017-05-23 11:58             ` Thomas Gleixner
2017-05-23 12:51               ` David Laight
2017-05-23 13:02                 ` Thomas Gleixner
2017-05-22 13:32         ` Arnd Bergmann
2017-05-22 19:14           ` Thomas Gleixner

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.DEB.2.20.1705211959370.3023@nanos \
    --to=tglx@linutronix.de \
    --cc=arnd@arndb.de \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.gross@intel.com \
    --cc=tj@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

all inboxes | Powered by JetHome®