From: Luiz Capitulino <lcapitulino@redhat.com>
To: "Jiang, Yunhong" <yunhong.jiang@intel.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [HACK] nohz: improve nohz idle hadling in nohz full cores (was Re: The tick when exit idle for nohz_full cpu)
Date: Fri, 11 Sep 2015 16:14:11 -0400 [thread overview]
Message-ID: <20150911161411.285cfadf@redhat.com> (raw)
In-Reply-To: <DDCAE26804250545B9934A2056554AA020AFDEAA@ORSMSX112.amr.corp.intel.com>
On Thu, 3 Sep 2015 01:46:24 +0000
"Jiang, Yunhong" <yunhong.jiang@intel.com> wrote:
> Hi, Frederic
> I noticed currently the tick_nohz_idle_exit() will always restart the sched_tick, even when it's on the nohz_full cpu. I'm not sure if we can keep the sched_tick stopped if it's on a nohz_full_cpu. The sched tick will be enabled on tick_nohz_task_switch() if needed. Is it ok to keep the sched tick off in the scheduling process?
There's also the case where the tick is already de-activated when a nohz
full core enters idle. In this case, an RT app that's solely running in
the core will hit nohz idle handling overhead and will get the tick restarted
on wakeup... Just to be de-activated in the next interrupt.
I think what we want is:
1. If the tick is already de-activated when entering idle, skip
tick_nohz_idle_enter() and tick_nohz_idle_exit()
2. Don't restart the tick when exiting idle for nohz full cores
I've tried to come up with something, I'm not entirely skipping
tick_nohz_idle_enter() and tick_nohz_idle_exit() because I'm not sure how
the bookkeeping there is used.
Frederic, does this look like something we could do?
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 3319e16..ecee8ca 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -781,6 +781,8 @@ static void __tick_nohz_idle_enter(struct tick_sched *ts)
int cpu = smp_processor_id();
now = tick_nohz_start_idle(ts);
+ if (tick_nohz_full_cpu(cpu) && ts->tick_stopped)
+ return;
if (can_stop_idle_tick(cpu, ts)) {
int was_stopped = ts->tick_stopped;
@@ -909,7 +911,8 @@ void tick_nohz_idle_exit(void)
tick_nohz_stop_idle(ts, now);
if (ts->tick_stopped) {
- tick_nohz_restart_sched_tick(ts, now);
+ if (!tick_nohz_full_cpu(smp_processor_id()))
+ tick_nohz_restart_sched_tick(ts, now);
tick_nohz_account_idle_ticks(ts);
}
--
2.1.0
prev parent reply other threads:[~2015-09-11 20:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-03 1:46 The tick when exit idle for nohz_full cpu Jiang, Yunhong
2015-09-11 20:14 ` Luiz Capitulino [this message]
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=20150911161411.285cfadf@redhat.com \
--to=lcapitulino@redhat.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=yunhong.jiang@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.