From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Oleg Nesterov <oleg@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH 5/6] posix-timers: Spare workqueue if there is no full dynticks CPU to kick
Date: Thu, 7 Nov 2013 19:16:30 +0100 [thread overview]
Message-ID: <1383848191-30807-6-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1383848191-30807-1-git-send-email-fweisbec@gmail.com>
After a posix cpu timer is set, a workqueue is scheduled in order to
kick the full dynticks CPUs and let them restart their tick if
necessary in case the task they are running is concerned by the
new timer.
This kick is implemented by way of IPIs, which require interrupts
to be enabled, hence the need for a workqueue to raise them because
the posix cpu timer set path has interrupts disabled.
Now if there is no full dynticks CPU on the system, the workqueue is
still scheduled but it simply won't send any IPI and return immediately.
So lets spare that worqueue when it is not needed.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
---
kernel/posix-cpu-timers.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index c7f31aa..35509c5 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -608,7 +608,8 @@ static DECLARE_WORK(nohz_kick_work, nohz_kick_work_fn);
*/
static void posix_cpu_timer_kick_nohz(void)
{
- schedule_work(&nohz_kick_work);
+ if (context_tracking_is_enabled())
+ schedule_work(&nohz_kick_work);
}
bool posix_cpu_timers_can_stop_tick(struct task_struct *tsk)
--
1.8.3.1
next prev parent reply other threads:[~2013-11-07 18:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-07 18:16 [PATCH 0/6] timers: updates for 3.13 preview Frederic Weisbecker
2013-11-07 18:16 ` [PATCH 1/6] nohz: Convert a few places to use local per cpu accesses Frederic Weisbecker
2013-11-07 18:16 ` [PATCH 2/6] trivial: fix spelling in CONTEXT_TRACKING_FORCE help text Frederic Weisbecker
2013-11-07 18:16 ` [PATCH 3/6] context_tracking: Wrap static key check into more intuitive function name Frederic Weisbecker
2013-11-07 18:16 ` [PATCH 4/6] context_tracking: Rename context_tracking_active() to context_tracking_cpu_is_enabled() Frederic Weisbecker
2013-11-07 18:16 ` Frederic Weisbecker [this message]
2013-11-07 18:16 ` [PATCH 6/6] posix-timers: Fix full dynticks CPUs kick on timer rescheduling Frederic Weisbecker
2013-12-03 14:38 [GIT PULL v2] dynticks updates for 3.14 Frederic Weisbecker
2013-12-03 14:38 ` [PATCH 5/6] posix-timers: Spare workqueue if there is no full dynticks CPU to kick Frederic Weisbecker
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=1383848191-30807-6-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.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®