From: Byungchul Park <byungchul.park@lge.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org,
fweisbec@gmail.com, tglx@linutronix.de
Subject: Re: [PATCH v3 2/2] sched: consider missed ticks when updating global cpu load
Date: Sun, 4 Oct 2015 15:58:19 +0900 [thread overview]
Message-ID: <20151004065819.GS6455@byungchulpark-X58A-UD3R> (raw)
In-Reply-To: <20151002155906.GD3816@twins.programming.kicks-ass.net>
On Fri, Oct 02, 2015 at 05:59:06PM +0200, Peter Zijlstra wrote:
> On Fri, Oct 02, 2015 at 04:46:14PM +0900, byungchul.park@lge.com wrote:
> > From: Byungchul Park <byungchul.park@lge.com>
> >
> > in hrtimer_interrupt(), the first tick_program_event() can be failed
> > because the next timer could be already expired due to,
> > (see the comment in hrtimer_interrupt())
> >
> > - tracing
> > - long lasting callbacks
>
> If anything keeps interrupts disabled for longer than 1 tick, you'd
> better go fix that.
tracing and long lasting callbacks are not my case.
>
> > - being scheduled away when running in a VM
this is my case.
>
> Not sure how much I should care about that, and this patch is completely
> wrong for that anyhow.
do you mean, in upper case, we must assume ticks occur with 1 tick interval
when update_process_times() is called even though more than 1 tick is
actually passed in host? right? i am really wondering it. i would admit i
was wrong if what you mean is same as what i understand.
>
> And this case in hrtimer_interrupt() is basically a fail case, if you
> hit that, you've got bigger problems. The solution is to rework things
> so you don't get there.
>
>
> > in the case that the first tick_program_event() is failed, the second
> > tick_program_event() set the expired time to more than one tick later.
> > then next tick can happen after more than one tick, even though tick is
> > not stopped by e.g. NOHZ.
> >
> > when the next tick occurs, update_process_times() -> scheduler_tick()
> > -> update_cpu_load_active() is performed, assuming the distance between
> > last tick and current tick is 1 tick! it's wrong in this case. thus,
> > this abnormal case should be considered in update_cpu_load_active().
>
> Everything in update_process_times() assumes 1 tick, just fixing up
> one function inside that callchain is wrong -- I've already told you
> that.
anyway, it's wrong for update_process_times() to assume 1 tick because
tick_irq_exit() -> tick_nohz_irq_exit() -> tick_nohz_full_update_tick()
-> tick_nohz_restart_sched_tick() can happen at full NOHZ as i already
said. in this full NOHZ case for tick to restart from non-idle,
1. update_process_times() -> account_process_tick() must be able to handle
more than one tick, or tick_nohz_restart_sched_tick() should handle the
case additionally. (i think the latter is better.) i will try to modify
the code to handle it if you agree with me.
2. to handle full NOHZ, tick_nohz_restart_sched_tick() should call
update_cpu_load_active() instead of update_cpu_load_nohz() with my 1/2
patch and 2/2 patch, or we should modify update_cpu_load_nohz() to know
full NOHZ, which currently don't know full NOHZ. (you may agree with the
latter.) in any case, 1/2 patch is necessary which current code is
absolutely missing.
peter, what do you think about my opinion? and about my 1/2 patch?
i will modify 2/2 patch depending on your feedback.
>
>
> --
> 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-04 6:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 7:46 [PATCH v3 0/2] sched: consider missed ticks when updating " byungchul.park
2015-10-02 7:46 ` [PATCH v3 1/2] sched: make __update_cpu_load() handle active tickless case byungchul.park
2015-10-02 7:46 ` [PATCH v3 2/2] sched: consider missed ticks when updating global cpu load byungchul.park
2015-10-02 15:59 ` Peter Zijlstra
2015-10-04 6:58 ` Byungchul Park [this message]
2015-10-05 8:15 ` Peter Zijlstra
2015-10-12 17:45 ` Frederic Weisbecker
2015-10-13 7:04 ` Peter Zijlstra
2015-10-13 8:37 ` Byungchul Park
2015-10-13 14:55 ` Frederic Weisbecker
2015-10-13 14:51 ` Frederic Weisbecker
2015-10-13 14:56 ` Peter Zijlstra
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=20151004065819.GS6455@byungchulpark-X58A-UD3R \
--to=byungchul.park@lge.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.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®