From: Yunhong Jiang <yunhong.jiang@linux.intel.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer.
Date: Mon, 26 Oct 2015 09:26:24 -0700 [thread overview]
Message-ID: <20151026162624.GA24041@jnakajim-build> (raw)
In-Reply-To: <20151024032054.GC16569@ubuntu>
On Sat, Oct 24, 2015 at 08:50:54AM +0530, Viresh Kumar wrote:
> On 23-10-15, 15:10, Yunhong Jiang wrote:
> > I got this impression from Frederic's comments on
> > http://marc.info/?l=linux-kernel&m=139048415303210&w=2, "So you simply rely
> > on the next tick to see the new timer. This should work with
> > CONFIG_NO_HZ_IDLE but not with CONFIG_NO_HZ_FULL since the target may be
> > running without the tick".
> > Per my understanding of this comment, it means we can rely on the next tick
> > for CONFIG_NO_HZ_IDLE, which means it's sure a tick will happen for
> > CONFIG_NO_HZ_IDLE, am I right?
>
> Yeah, the CPU wouldn't like in idle for ever but the time is not known
> and it can be really really long.
>
> > Hmm, per http://lxr.free-electrons.com/source/include/linux/timer.h#L51, the
> > deferreable timer will be serviced when the CPU eventually wakes up "with a
> > subsequent non-deferrable timer".
>
> It will be an IPI mostly..
>
> > If there is no non-deferrable timer, based
> > on Frederic's comments, we in fact depends on next tick.
>
> So, the cpu will wake up when it receives an IPI. The first thing we
> do then is to restart the tick and we will then service all the
> pending deferred timers.
>
> > My confusion is, why we are sure there is next tick on CONFIG_NO_HZ_IDLE
> > idle processor to wake it up. If there is no tick, and no other timer, will
> > the timer get no chance to be waken up at all? I don't think "deferred for
> > ever" is deferreable.
>
> There are many kind of works we may want to do. If its really
> important to be done earlier, then it should be serviced with a timer.
>
> deferred timers are better used for activities, which are irrelevant
> once the CPU is idle. One case is doing some per-cpu load tracking for
> cpufreq governors or the work that vmstat does.
>
> Even if the CPU wakes up after few hours (hypothetically), it
> shouldn't matter.
Viresh, thanks for the clarification.
So seems the original patch is correct to wakeup the full dyntick CPU even
for deferred timer. Thomas/Fred, your idea?
Thanks
--jyh
>
> --
> viresh
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2015-10-26 16:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 18:48 [PATCH] timer: Lazily wakup nohz CPU when adding new timer Yunhong Jiang
2015-10-05 20:51 ` Yunhong Jiang
2015-10-11 18:12 ` Thomas Gleixner
2015-10-20 22:47 ` Yunhong Jiang
2015-10-21 10:46 ` Viresh Kumar
2015-10-22 21:40 ` Yunhong Jiang
2015-10-23 2:19 ` Viresh Kumar
2015-10-23 22:10 ` Yunhong Jiang
2015-10-24 3:20 ` Viresh Kumar
2015-10-26 16:26 ` Yunhong Jiang [this message]
2015-10-27 15:11 ` Frederic Weisbecker
2015-11-13 16:13 ` 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=20151026162624.GA24041@jnakajim-build \
--to=yunhong.jiang@linux.intel.com \
--cc=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