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: Mon, 22 May 2017 21:14:36 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1705222106390.2407@nanos> (raw)
In-Reply-To: <CAK8P3a0uF-=7Ot16YpsyuZHVaoE1rLR6q7w5r4+uXkaVdPHT4A@mail.gmail.com>
On Mon, 22 May 2017, Arnd Bergmann wrote:
> On Sun, May 21, 2017 at 7:13 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> I agree, one of the above is good enough, if we do the large-scale API
> replacement. Having both ms and sec variants would be for convenience
> to avoid having lots of open-coded '*MSEC_PER_SEC) multiplications.
Right, but that _sec variant is just a wrapper around the _ms functionality.
> We still need at least three variants of timer_init, for statically initialized
> timers, dynamic allocation and on-stack allocation, as before.
Again, that's variants. What I wanted to avoid is that mod_ restart_ start_
whatever distinction. It's pointless.
> For the 'abs' argument, I'd probably leave that out until we find code
> that actually needs it and that can't use hrtimer as easily.
> For timer_start_on(), that would be a replacement of add_timer_on(),
> which only has seven callers today:
> arch/x86/kernel/apic/x2apic_uv_x.c: add_timer_on(timer, cpu);
> drivers/tty/metag_da.c: add_timer_on(poll_timer, 0);
> drivers/tty/mips_ejtag_fdc.c:
> add_timer_on(&priv->poll_timer, dev->cpu);
> drivers/tty/mips_ejtag_fdc.c:
> add_timer_on(&priv->poll_timer, dev->cpu);
> kernel/time/clocksource.c: add_timer_on(&watchdog_timer, next_cpu);
> kernel/time/clocksource.c: add_timer_on(&watchdog_timer,
> cpumask_first(cpu_online_mask));
> kernel/workqueue.c: add_timer_on(timer, cpu);
>
> If hrtimer isn't already a better interface for those, we can probably
> convert them all to the new API at once.
Some of them certainly can be converted. Though I'm starting to worry about
massive hrtimer usage, which can really become a burden because the expiry
functions run from hard interrupt context. We already have this horrible
construct of hrtimer -> tasklet -> real function, which is used to get the
hrtimer expiry out into softirq context.
We have similar issue in RT, where we need to move out everything which is
not hard irq safe to softirq context. I'm working on a solution there which
is less ugly than what we have now in RT. It's moving non irq safe timers
onto a different time base, e.g. MONOTONIC_SOFT, which merily wakes the
softirq when the first queued timer expires and let that one sort out the
expiry of those timers. It's WIP and should be available soon.
Thanks,
tglx
prev parent reply other threads:[~2017-05-22 19:14 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
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 [this message]
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.1705222106390.2407@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®