public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: [PATCH 1/5] timer: Store cpu-number in 'struct tvec_base'
Date: Sun, 22 Jun 2014 01:29:13 +0200	[thread overview]
Message-ID: <1403393357-2070-2-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1403393357-2070-1-git-send-email-fweisbec@gmail.com>

From: Viresh Kumar <viresh.kumar@linaro.org>

Timers are serviced by the tick. But when a timer is enqueued on a
dynticks target, we need to kick it in order to make it reconsider the
next tick to schedule to correctly handle the timer's expiring time.

Now while this kick is correctly performed for add_timer_on(), the
mod_timer*() family has been a bit neglected.

To prepare for fixing this, we need internal_add_timer() to be able to
resolve the CPU target associated to a timer's object 'base' so that the
kick can be centralized there.

This can't be passed as an argument as not all the callers know the CPU
number of a timer's base. So lets store it in the struct tvec_base to
resolve the CPU without much overhead. It is set once for good at every
CPU's first boot.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 kernel/timer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/timer.c b/kernel/timer.c
index 3bb01a3..9e5f4f2 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -82,6 +82,7 @@ struct tvec_base {
 	unsigned long next_timer;
 	unsigned long active_timers;
 	unsigned long all_timers;
+	int cpu;
 	struct tvec_root tv1;
 	struct tvec tv2;
 	struct tvec tv3;
@@ -1568,6 +1569,7 @@ static int init_timers_cpu(int cpu)
 		}
 		spin_lock_init(&base->lock);
 		tvec_base_done[cpu] = 1;
+		base->cpu = cpu;
 	} else {
 		base = per_cpu(tvec_bases, cpu);
 	}
-- 
1.8.3.1


  reply	other threads:[~2014-06-21 23:29 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 ` Frederic Weisbecker [this message]
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:timers/core] hrtimer: Store cpu-number in struct hrtimer_cpu_base tip-bot for Viresh Kumar
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=1403393357-2070-2-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=linux-kernel@vger.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