From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Haris Okanovic <haris.okanovic@ni.com>
Cc: linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org,
tglx@linutronix.de, julia.cartwright@ni.com,
gratian.crisan@ni.com
Subject: Re: [RFC v2] timers: Don't wake ktimersoftd on every tick
Date: Fri, 23 Dec 2016 18:28:55 +0100 [thread overview]
Message-ID: <20161223172855.oulixazoxikkkijp@linutronix.de> (raw)
In-Reply-To: <20161213214405.28554-1-haris.okanovic@ni.com>
On 2016-12-13 15:44:05 [-0600], Haris Okanovic wrote:
> Changed the way timers are collected per Julia and Thomas'
I can only see Julia's response to the initial thread.
> recommendation: Expired timers are now collected in interrupt context
> and fired in ktimersoftd to avoid double-walk of `pending_map`.
>
> This is implemented by storing lists of expired timers in timer_base,
> which carries a memory overhead 9*sizeof(pointer) per CPU. The timer
> system uses hlist's which don't have end-node references, making it
> impossible to merge 2 hlist's in constant time. I.e. Merging requires
> walking one list. I also considered switching `vectors` to regular
> list's which don't have this limitations, but that approach has the same
> memory overhead. list_head is bigger than hlist_head by sizeof(pointer)
> and is instantiated 9+ times per CPU as `vectors`. I believe the only
> way to trim overhead is to spend more CPU cycles in interrupt context
> either in list merging (unbounded operation) or the original double-walk
> implementation. Any suggestions/preferences?
>
> As before, a 6h run of cyclictest without CPU affinity shows decrease in
> 22-70us latency range.
what does this mean? Your cyclictest runs on a random CPU with one thread
only?
> No change in max jitter.
Does this mean your average latency went down 20-70us and your max is
the same?
> No change when `-S` is
> used.
-S gives you one thread per core, makes sure it stays on that core and
uses clock_nanosleep().
clock_nanosleep() should be used no matter what.
> [Before/after traces]
>
> ftp://ftp.ni.com/outgoing/tp02-timer-peek-traces.tgz
> (Email me if link dies. Server periodically purges old files.)
>
> [Hardware/software/config]
>
> NI cRIO-9033
> 2 core Intel Atom CPU
>
> Kernel 4.8.6-rt5
> CONFIG_HZ_PERIODIC=y
>
> [Outstanding concerns/issues/questions]
>
> I'm relatively new to the timer subsystem, so please feel free to poke
> as many holes as possible in this change. A few things that concern me
> at the moment are:
>
> Can jiffies change while one or more cpus is inside tick_sched_timer(),
> in interrupt context? I'm copying jiffies to a local variable in
> find_expired_timers() to ensure it doesn't run unbounded, but I'm not
> sure if that's necessary.
It could change. Only the house keeping does update jiffies in
tick_sched_do_timer().
> Any special considerations for testing NO_HZ builds? (Other than letting
> it run idle for a while)
>
> timers_dead_cpu() presently asserts no timer callback is actively
> running, which suggests that timers must be canceled prior to disabling
> CPUs; otherwise, there's a race between active timers and hotplug
> which can crash the whole kernel. Is this a safe assumption to make and
> are there any special considerations for CPU hotplug testing?
timers_dead_cpu() and hrtimers_dead_cpu() migrate timer away. At that
point the CPU should be down already so a timer can't run on that CPU.
> Other tests/performance benchmark I should run?
>
> Source: https://github.com/harisokanovic/linux/tree/dev/hokanovi/timer-peek-v2
>
> Thanks,
> Haris
Sebastian
next prev parent reply other threads:[~2016-12-23 17:29 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-13 21:44 Haris Okanovic
2016-12-23 17:28 ` Sebastian Andrzej Siewior [this message]
2016-12-28 18:06 ` Haris Okanovic
2017-02-03 16:51 ` Sebastian Andrzej Siewior
2017-02-03 18:21 ` [PATCH] " Haris Okanovic
2017-02-10 17:02 ` Sebastian Andrzej Siewior
2017-05-26 17:16 ` [PATCH] Revert "timers: Don't wake ktimersoftd on every tick" Anna-Maria Gleixner
2017-05-26 19:27 ` Haris Okanovic
2017-05-26 19:49 ` Thomas Gleixner
2017-05-26 20:25 ` Haris Okanovic
2017-05-26 20:50 ` Thomas Gleixner
2017-06-02 14:37 ` Haris Okanovic
2017-06-04 14:17 ` Thomas Gleixner
2017-07-17 21:58 ` Haris Okanovic
2017-07-17 22:04 ` [PATCH v2] timers: Don't wake ktimersoftd on every tick Haris Okanovic
2017-07-18 21:33 ` Thomas Gleixner
2017-08-03 21:04 ` Haris Okanovic
2017-08-03 21:06 ` [PATCH v3 1/2] " Haris Okanovic
2017-08-03 21:06 ` [PATCH v3 2/2] timers: Don't search for expired timers while TIMER_SOFTIRQ is scheduled Haris Okanovic
2018-01-05 19:37 ` Haris Okanovic
2018-03-01 15:49 ` Haris Okanovic
2018-03-01 15:54 ` Thomas Gleixner
2018-03-01 16:35 ` Haris Okanovic
2018-03-01 16:47 ` Sebastian Andrzej Siewior
2018-03-01 18:37 ` Haris Okanovic
2018-03-01 19:06 ` Sebastian Andrzej Siewior
2018-03-02 14:52 ` Sebastian Andrzej Siewior
2018-03-02 16:29 ` Haris Okanovic
2018-03-02 16:39 ` Sebastian Andrzej Siewior
2018-03-02 17:19 ` Haris Okanovic
2018-03-06 23:39 ` [PATCH v4 1/2] timers: Don't wake ktimersoftd on every tick Haris Okanovic
2018-03-06 23:39 ` [PATCH v4 2/2] timers: Don't search for expired timers while TIMER_SOFTIRQ is scheduled Haris Okanovic
[not found] ` <1523332961.4827.1.camel@gmx.de>
2018-04-12 15:00 ` [PATCH v4 1/2] timers: Don't wake ktimersoftd on every tick Haris Okanovic
2018-06-19 12:43 ` Daniel Bristot de Oliveira
2018-06-20 14:24 ` Haris Okanovic
2018-06-28 16:36 ` Haris Okanovic
2018-06-28 16:40 ` [PATCH v5 " Haris Okanovic
2018-06-28 16:40 ` [PATCH v5 2/2] timers: Don't search for expired timers while TIMER_SOFTIRQ is scheduled Haris Okanovic
2018-07-13 12:01 ` [PATCH v5 1/2] timers: Don't wake ktimersoftd on every tick Anna-Maria Gleixner
2018-07-13 14:37 ` Haris Okanovic
2017-05-27 7:47 ` [PATCH] Revert "timers: Don't wake ktimersoftd on every tick" Sebastian Andrzej Siewior
2017-02-03 18:27 ` [RFC v2] timers: Don't wake ktimersoftd on every tick Haris Okanovic
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=20161223172855.oulixazoxikkkijp@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=gratian.crisan@ni.com \
--cc=haris.okanovic@ni.com \
--cc=julia.cartwright@ni.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=tglx@linutronix.de \
/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®