From: Yury Norov <ynorov@caviumnetworks.com>
To: Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: Yury Norov <ynorov@caviumnetworks.com>,
"Goutham, Sunil" <Sunil.Goutham@cavium.com>,
Chris Metcalf <cmetcalf@mellanox.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] nohz: don't kick non-idle CPUs in tick_nohz_full_kick_cpu()
Date: Thu, 12 Jul 2018 21:19:22 +0300 [thread overview]
Message-ID: <20180712181922.23073-1-ynorov@caviumnetworks.com> (raw)
IIUC, tick_nohz_full_kick_cpu() is intended to wakeup idle CPUs
that will not be poked by scheduler because they are actually
nohz_full.
But in fact this function kicks all CPUs listed in tick_nohz_full_mask,
namely:
- idle CPUs;
- CPUs runnung normal tasks;
- CPUs running isolated tasks [1];
For normal tasks it introduces unneeded latency, and for isolated tasks
it's fatal because isolation gets broken and task receives SIGKILL.
The patch below makes tick_nohz_full_kick_cpu() kicking only idle CPUs.
Non-idle nohz_full CPUs will observe changed system settings just like
non-idle normal (i.e. not nohz_full) CPUs, at next reschedule.
[1] https://lkml.org/lkml/2017/11/3/589
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
kernel/time/tick-sched.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index c026145eba2f..1c24c700e75a 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -247,7 +247,7 @@ static void tick_nohz_full_kick(void)
*/
void tick_nohz_full_kick_cpu(int cpu)
{
- if (!tick_nohz_full_cpu(cpu))
+ if (!(tick_nohz_full_cpu(cpu) && idle_cpu(cpu)))
return;
irq_work_queue_on(&per_cpu(nohz_full_kick_work, cpu), cpu);
--
2.17.1
next reply other threads:[~2018-07-12 18:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-12 18:19 Yury Norov [this message]
2018-07-16 15:31 ` Frederic Weisbecker
2018-07-19 20:22 ` Yury Norov
2018-07-20 17:24 ` Thomas Gleixner
2018-07-23 13:15 ` 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=20180712181922.23073-1-ynorov@caviumnetworks.com \
--to=ynorov@caviumnetworks.com \
--cc=Sunil.Goutham@cavium.com \
--cc=cmetcalf@mellanox.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@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®