mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Christoph Lameter <cl@linux.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org,
	Gilad Ben-Yossef <gilad@benyossef.com>, Tejun Heo <tj@kernel.org>,
	John Stultz <john.stultz@linaro.org>,
	Mike Frysinger <vapier@gentoo.org>,
	Minchan Kim <minchan.kim@gmail.com>,
	Hakan Akkan <hakanakkan@gmail.com>,
	Max Krasnyansky <maxk@qti.qualcomm.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Hugh Dickins <hughd@google.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [NOHZ] Remove scheduler_tick_max_deferment
Date: Mon, 10 Nov 2014 21:26:59 +0100	[thread overview]
Message-ID: <20141110202655.GB29741@lerouge> (raw)
In-Reply-To: <alpine.DEB.2.11.1411011646280.7732@gentwo.org>

On Sat, Nov 01, 2014 at 04:52:13PM -0500, Christoph Lameter wrote:
> On Sat, 1 Nov 2014, Thomas Gleixner wrote:
> 
> > On Fri, 31 Oct 2014, Christoph Lameter wrote:
> > > The reasoning behind this function is not clear to me and removal seems
> >
> > The comment above the function is clear enough.
> 
> I looked around into the functions called by the timer interrupt for
> accounting etc. They have measures to compensate if the HZ is not
> occurring for some time.

Not very well. They handle correctly dynticks idle but not dynticks full.
Checkout update_cpu_load_active() -> __update_cpu_load() for example.

There is a pending_update argument that take care of tickless delta but
decay_load_miss() catch up with the missing cpu load assuming it was all 0 (idle)
all that time.

Generally speaking the scheduler assume dynticks to be idle dynticks. And that
concerns the above example and probably many other accounting.

Now the issue with update_cpu_load_active() is there, whether we keep 1 Hz or not,
any delta of full dynticks workload makes it buggy because it's accounted as idle
load.

But removing the 1 Hz residual tick is dangerous because many accounting in the
scheduler tick assume regular updates. It's mostly ok as long as the accounting
is exclusively updated and read locally. But some accounting is also updated locally
and read remotely. So if CPU 0 is full dynticks and runs for 1 hour in userspace and
CPU 1 reads its stats, those will be buggy because of the missing updates. At best
in this scenarion CPU 1 may consider that CPU 0 has been idle for 1 hour, at worst
the stats can be junk and there can be crashes. Also a lot of the scheduler decisions
is based on these accountings. Load balancing to the least.

So we have two possible solutions:

1) Make the scheduler more full-dynticks aware. Which means that any remote
stat accounting read must handle out of date results. That's going to be tricky: if
you check scheduler_tick() and sched_class::task_tick(), even simply trying to
sort out which stat is updated, can handle busy dynticks load, is read only locally
or can be read remotely, handles overflow, etc... That's enough work for an army of ants.

2) Offload scheduler_tick() to the housekeeping. It looks like many of the updaters
there can easily take a remote rq argument. There doesn't seem to be much local rq
assumption. So that's the easiest solution.

But we can't just remove scheduler_tick_max_deferment() and not fix things behind.
The result will be unpredictably insane and dangerous. The only predictable thing
that's going to happen if we do that is that nobody will ever fix it properly.

      parent reply	other threads:[~2014-11-10 20:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 16:01 Christoph Lameter
2014-11-01 19:18 ` Thomas Gleixner
2014-11-01 21:52   ` Christoph Lameter
2014-11-01 22:33     ` Thomas Gleixner
2014-11-06 17:24       ` Christoph Lameter
2014-11-10  7:11         ` Viresh Kumar
2014-11-10 15:31           ` Paul E. McKenney
2014-11-10 16:21             ` Christoph Lameter
2014-11-10 18:26             ` Christoph Lameter
2014-11-11 17:15               ` Future of NOHZ full/isolation development (was Re: [NOHZ] Remove scheduler_tick_max_deferment) Frederic Weisbecker
2014-11-11 17:39                 ` Paul E. McKenney
2014-11-11 18:00                   ` Christoph Lameter
2014-11-12  6:11                 ` Viresh Kumar
2014-11-12 13:54                   ` Frederic Weisbecker
2014-11-12 14:56                     ` Viresh Kumar
2014-11-12 15:06                       ` Peter Zijlstra
2014-11-12 15:16                         ` Viresh Kumar
2014-11-13  7:22                           ` Viresh Kumar
2014-11-10 16:19           ` [NOHZ] Remove scheduler_tick_max_deferment Christoph Lameter
2014-11-10 22:43         ` Frederic Weisbecker
2014-11-11 14:58           ` Christoph Lameter
2014-11-11 15:36             ` Frederic Weisbecker
2014-11-11 17:08               ` Christoph Lameter
2014-11-10 20:26     ` Frederic Weisbecker [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=20141110202655.GB29741@lerouge \
    --to=fweisbec@gmail.com \
    --cc=cl@linux.com \
    --cc=gilad@benyossef.com \
    --cc=hakanakkan@gmail.com \
    --cc=hpa@zytor.com \
    --cc=hughd@google.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxk@qti.qualcomm.com \
    --cc=minchan.kim@gmail.com \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=vapier@gentoo.org \
    --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

all inboxes | Powered by JetHome®