Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1680724

Re: [PATCH v2] sched/pelt: fix false running accounting

Path csiph.com!news.redatomik.org!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Vincent Guittot <vincent.guittot@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2] sched/pelt: fix false running accounting
Date Tue, 04 Jul 2017 09:40:02 +0200
Message-ID <tZqBc-5fa-11@gated-at.bofh.it> (permalink)
References <tY4CK-6b8-11@gated-at.bofh.it> <tYiPn-6Y4-3@gated-at.bofh.it> <tZqrw-5a4-31@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oOyvQ5sN95cKqyAoSKOqIiKR7mz8+ZwxDFgUykI25+U=; b=N6oVbw9AIJ4GvePreRlbLByCg239yh+JOd8SLmlwWVEZ3GO6nIYVJMg3Y9nqMokN+e BzdqWSwIEX5zRnF4D4LHczwb/1GN4NUBWBzQu+KkOwSFYF0sXcyyJ3eibAnhmotKQuTU XtSClUCrGuKfKEpOtIOcTB2YEgUVimFzkAL1Q=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oOyvQ5sN95cKqyAoSKOqIiKR7mz8+ZwxDFgUykI25+U=; b=afr6SoFsDWlHjtkYrfp9V63VEvI+J8RqiBoF6eRHT26ZpJj93iWcn3b2BFSXFHM+Qb aYNqp0EGJVI7ux5c7FJ2vsmGFCSuC7tfcjhqBXglxka9VCsbfgYRiyhj6Qqi66unmgtI l7jsMu2d2ma4yBsdFSQsfQQNKig5dWspIKfUkA+hAdvCVqUa4+RpnqlXXtjYipnGLYFt rWsQXWl5lkzCTFgoS8xOT+q5sQo61H7bJJ3BmjkhixpdFOF9XqkPGL6Fof1gKvbipdWD 6wDakmjwCtgiLim46fVSpUtcqQgc0thFaXi7YB7snJ/WoHG+/3jMgkdMRD5V79C0tpdE R+pA==
X-Gm-Message-State AKS2vOwnrRQDaANgJTntbIzlNGtslOdQCCbLTy+5LzTzYRlD2bV7WPlB LvKtIEjCOEXn6e6Ab8jjPlvkf57LRDE1kw7X6w==
X-Received by 10.46.82.23 with SMTP id g23mr10160917ljb.32.1499153895535; Tue, 04 Jul 2017 00:38:15 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset="UTF-8"
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 26
Organization linux.* mail to news gateway
X-Original-Cc Ingo Molnar <mingo@kernel.org>, linux-kernel <linux-kernel@vger.kernel.org>, Dietmar Eggemann <dietmar.eggemann@arm.com>, Morten Rasmussen <Morten.Rasmussen@arm.com>
X-Original-Date Tue, 4 Jul 2017 09:37:54 +0200
X-Original-Message-ID <CAKfTPtC7ENpZ707ufpJpuNL2pw4pVuy4RAwbkUA_OZd1EJfO0Q@mail.gmail.com>
X-Original-References <1498831118-22672-1-git-send-email-vincent.guittot@linaro.org> <1498885573-18984-1-git-send-email-vincent.guittot@linaro.org> <20170704072707.sft22eph26p5v5og@hirez.programming.kicks-ass.net>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1680724

Show key headers only | View raw


On 4 July 2017 at 09:27, Peter Zijlstra <peterz@infradead.org> wrote:
> On Sat, Jul 01, 2017 at 07:06:13AM +0200, Vincent Guittot wrote:
>> The running state is a subset of runnable state which means that running
>> can't be set if runnable (weight) is cleared. There are corner cases
>> where the current sched_entity has been already dequeued but cfs_rq->curr
>> has not been updated yet and still points to the dequeued sched_entity.
>> If ___update_load_avg is called at that time, weight will be 0 and running
>> will be set which is not possible.
>>
>> This case happens during pick_next_task_fair() when a cfs_rq becomes idles.
>> The current sched_entity has been dequeued so se->on_rq is cleared and
>> cfs_rq->weight is null. But cfs_rq->curr still points to se (it will be
>> cleared when picking the idle thread). Because the cfs_rq becomes idle,
>> idle_balance() is called and ends up to call update_blocked_averages()
>> with these wrong running and runnable states.
>>
>> Add a test in ___update_load_avg to correct the running state in this case.
>
> Cute, however did you find that ?

In fact, while rebasing and running more tests on my patch "update
scale invariance of PELT" that changes how to scale the load and
utilization, I have seen that sometimes the utilization was increasing
but not the load when CPU was going into idle state because the
stolen_idle time was applied as idle time for load but running time
for utilization. This patch has highlighted the problem.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2] sched/pelt: fix false running accounting Peter Zijlstra <peterz@infradead.org> - 2017-07-04 09:30 +0200
  Re: [PATCH v2] sched/pelt: fix false running accounting Vincent Guittot <vincent.guittot@linaro.org> - 2017-07-04 09:40 +0200
  Re: [PATCH v2] sched/pelt: fix false running accounting Peter Zijlstra <peterz@infradead.org> - 2017-07-04 10:40 +0200
    Re: [PATCH v2] sched/pelt: fix false running accounting Vincent Guittot <vincent.guittot@linaro.org> - 2017-07-04 11:20 +0200
      Re: [PATCH v2] sched/pelt: fix false running accounting Peter Zijlstra <peterz@infradead.org> - 2017-07-04 11:50 +0200
        Re: [PATCH v2] sched/pelt: fix false running accounting Vincent Guittot <vincent.guittot@linaro.org> - 2017-07-04 12:00 +0200
          Re: [PATCH v2] sched/pelt: fix false running accounting Peter Zijlstra <peterz@infradead.org> - 2017-07-04 13:10 +0200

csiph-web