From: Peter Zijlstra <peterz@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Sasha Levin <levinsasha928@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
Dave Jones <davej@redhat.com>,
Andrey Ryabinin <a.ryabinin@samsung.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: sched: odd values for effective load calculations
Date: Mon, 15 Dec 2014 13:12:27 +0100 [thread overview]
Message-ID: <20141215121227.GZ29390@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20141213083012.GH32572@gmail.com>
Sorry for the long delay, I was out for a few weeks due to having become
a dad for the second time.
On Sat, Dec 13, 2014 at 09:30:12AM +0100, Ingo Molnar wrote:
> * Sasha Levin <levinsasha928@gmail.com> wrote:
>
> > Hi all,
> >
> > I was fuzzing with trinity inside a KVM tools guest, running the latest -next
> > kernel along with the undefined behaviour sanitizer patch, and hit the following:
> >
> > [ 787.894288] ================================================================================
> > [ 787.897074] UBSan: Undefined behaviour in kernel/sched/fair.c:4541:17
> > [ 787.898981] signed integer overflow:
> > [ 787.900066] 361516561629678 * 101500 cannot be represented in type 'long long int'
So that's:
this_eff_load *= this_load +
effective_load(tg, this_cpu, weight, weight);
Going by the numbers the 101500 must be 'this_eff_load', 100 * ~1024
makes that. Which makes the rhs 'large'. Do you have
CONFIG_FAIR_GROUP_SCHED enabled? If so, what kind of cgroup hierarchy
are you using?
In any case, bit sad this doesn't have a register dump included :/
Is this easy to reproduce or something that happened once?
> > The values for effective load seem a bit off (and are overflowing!).
>
> It definitely looks like a bug in SMP load balancing!
Yeah, although theoretically (and somewhat practical) this can be
triggered in more places if you manage to run up the 'weight' with
enough tasks.
That said, it should at worst result in 'funny' balancing behaviour, not
anything else.
next prev parent reply other threads:[~2014-12-15 12:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-02 22:53 Sasha Levin
2014-12-13 8:30 ` Ingo Molnar
2014-12-15 12:12 ` Peter Zijlstra [this message]
2014-12-15 13:14 ` Peter Zijlstra
2014-12-16 5:29 ` Sasha Levin
2014-12-16 15:37 ` Peter Zijlstra
2014-12-18 2:10 ` Yuyang Du
2014-12-16 4:51 ` Sasha Levin
2014-12-16 2:09 ` Yuyang Du
2014-12-19 0:29 ` Yuyang Du
2014-12-19 11:20 ` Peter Zijlstra
2015-01-09 12:33 ` [tip:sched/urgent] sched: Fix odd values in effective_load() calculations tip-bot for Yuyang Du
2014-12-16 15:33 ` sched: odd values for effective load calculations 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=20141215121227.GZ29390@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=a.ryabinin@samsung.com \
--cc=davej@redhat.com \
--cc=levinsasha928@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=torvalds@linux-foundation.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®