From: tip-bot for Viresh Kumar <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
fweisbec@gmail.com, viresh.kumar@linaro.org, tglx@linutronix.de
Subject: [tip:timers/core] hrtimer: Store cpu-number in struct hrtimer_cpu_base
Date: Mon, 23 Jun 2014 02:34:13 -0700 [thread overview]
Message-ID: <tip-cddd02489f52ccf635ed65931214729a23b93cd6@git.kernel.org> (raw)
In-Reply-To: <1403393357-2070-4-git-send-email-fweisbec@gmail.com>
Commit-ID: cddd02489f52ccf635ed65931214729a23b93cd6
Gitweb: http://git.kernel.org/tip/cddd02489f52ccf635ed65931214729a23b93cd6
Author: Viresh Kumar <viresh.kumar@linaro.org>
AuthorDate: Sun, 22 Jun 2014 01:29:15 +0200
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 23 Jun 2014 11:23:47 +0200
hrtimer: Store cpu-number in struct hrtimer_cpu_base
In lowres mode, hrtimers are serviced by the tick instead of a clock
event. Now it works well as long as the tick stays periodic but we
must also make sure that the hrtimers are serviced in dynticks mode.
Part of that job consist in kicking a dynticks hrtimer target in order
to make it reconsider the next tick to schedule to correctly handle the
hrtimer's expiring time. And that part isn't handled by the hrtimers
subsystem.
To prepare for fixing this, we need __hrtimer_start_range_ns() to be
able to resolve the CPU target associated to a hrtimer's object
'cpu_base' so that the kick can be centralized there.
So lets store it in the 'struct hrtimer_cpu_base' to resolve the CPU
without overhead. It is set once at CPU's online notification.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1403393357-2070-4-git-send-email-fweisbec@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/hrtimer.h | 2 ++
kernel/time/hrtimer.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index e7a8d3f..bb4ffff 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -165,6 +165,7 @@ enum hrtimer_base_type {
* struct hrtimer_cpu_base - the per cpu clock bases
* @lock: lock protecting the base and associated clock bases
* and timers
+ * @cpu: cpu number
* @active_bases: Bitfield to mark bases with active timers
* @clock_was_set: Indicates that clock was set from irq context.
* @expires_next: absolute time of the next event which was scheduled
@@ -179,6 +180,7 @@ enum hrtimer_base_type {
*/
struct hrtimer_cpu_base {
raw_spinlock_t lock;
+ unsigned int cpu;
unsigned int active_bases;
unsigned int clock_was_set;
#ifdef CONFIG_HIGH_RES_TIMERS
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 3ab2899..0e32d4e 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1680,6 +1680,7 @@ static void init_hrtimers_cpu(int cpu)
timerqueue_init_head(&cpu_base->clock_base[i].active);
}
+ cpu_base->cpu = cpu;
hrtimer_init_hres(cpu_base);
}
next prev parent reply other threads:[~2014-06-23 9:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-21 23:29 [PATCH 0/5] timer: Fix missing dynticks kick v2 Frederic Weisbecker
2014-06-21 23:29 ` [PATCH 1/5] timer: Store cpu-number in 'struct tvec_base' Frederic Weisbecker
2014-06-23 9:33 ` [tip:timers/core] timer: Store cpu-number in struct tvec_base tip-bot for Viresh Kumar
2014-06-21 23:29 ` [PATCH 2/5] timer: Kick dynticks targets on mod_timer*() calls Frederic Weisbecker
2014-06-23 9:34 ` [tip:timers/core] " tip-bot for Viresh Kumar
2014-06-21 23:29 ` [PATCH 3/5] hrtimer: Store cpu-number in 'struct hrtimer_cpu_base' Frederic Weisbecker
2014-06-23 9:34 ` tip-bot for Viresh Kumar [this message]
2014-06-21 23:29 ` [PATCH 4/5] hrtimer: Kick lowres dynticks targets on timer enqueue Frederic Weisbecker
2014-06-22 13:36 ` Thomas Gleixner
2014-06-23 4:44 ` Viresh Kumar
2014-06-23 8:09 ` [PATCH V2 " Viresh Kumar
2014-06-23 9:34 ` [tip:timers/core] " tip-bot for Viresh Kumar
2014-06-21 23:29 ` [PATCH 5/5] hrtimer: Remove hrtimer_enqueue_reprogram() Frederic Weisbecker
2014-06-23 9:34 ` [tip:timers/core] " tip-bot for Viresh Kumar
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=tip-cddd02489f52ccf635ed65931214729a23b93cd6@git.kernel.org \
--to=tipbot@zytor.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=viresh.kumar@linaro.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