linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Fleming <matt@codeblueprint.co.uk>
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Mike Galbraith <umgwanakikbuti@gmail.com>
Subject: Re: [PATCH] sched/fair: Avoid divide by zero when rebalancing domains
Date: Fri, 17 Aug 2018 11:27:34 +0100	[thread overview]
Message-ID: <20180817102734.GA4253@codeblueprint.co.uk> (raw)
In-Reply-To: <94149109-a54c-fc5d-7b56-e786c8de5b94@arm.com>

On Thu, 05 Jul, at 05:54:02PM, Valentin Schneider wrote:
> On 05/07/18 14:27, Matt Fleming wrote:
> > On Thu, 05 Jul, at 11:10:42AM, Valentin Schneider wrote:
> >> Hi,
> >>
> >> On 04/07/18 15:24, Matt Fleming wrote:
> >>> It's possible that the CPU doing nohz idle balance hasn't had its own
> >>> load updated for many seconds. This can lead to huge deltas between
> >>> rq->avg_stamp and rq->clock when rebalancing, and has been seen to
> >>> cause the following crash:
> >>>
> >>>  divide error: 0000 [#1] SMP
> >>>  Call Trace:
> >>>   [<ffffffff810bcba8>] update_sd_lb_stats+0xe8/0x560
> 
> My confusion comes from not seeing where that crash happens. Would you mind
> sharing the associated line number? I can feel the "how did I not see this"
> from there but it can't be helped :(

The divide by zero comes from scale_rt_capacity() where 'total' is a
u64 but gets truncated when passed to div_u64() since the divisor
parameter is u32.

Sure, you could use div64_u64() instead, but the real issue is that
the load hasn't been updated for a very long time and that we're
trying to balance the domains with stale data.

  reply	other threads:[~2018-08-17 10:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04 14:24 [PATCH] sched/fair: Avoid divide by zero when rebalancing domains Matt Fleming
2018-07-05  8:02 ` [lkp-robot] [sched/fair] fbd5188493: WARNING:inconsistent_lock_state kernel test robot
2018-07-05  8:58   ` Dietmar Eggemann
2018-07-05  9:52     ` Dietmar Eggemann
2018-07-05 13:24       ` Matt Fleming
2018-07-05 14:43         ` Matt Fleming
2018-07-05 14:59         ` Dietmar Eggemann
2018-07-05 10:10 ` [PATCH] sched/fair: Avoid divide by zero when rebalancing domains Valentin Schneider
2018-07-05 13:27   ` Matt Fleming
2018-07-05 16:54     ` Valentin Schneider
2018-08-17 10:27       ` Matt Fleming [this message]
2018-08-17 12:58         ` Valentin Schneider

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=20180817102734.GA4253@codeblueprint.co.uk \
    --to=matt@codeblueprint.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=umgwanakikbuti@gmail.com \
    --cc=valentin.schneider@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).