Re: sched: odd values for effective load calculations

Peter Zijlstra
2014-12-15T13:14:27Z

On Mon, Dec 15, 2014 at 01:12:27PM +0100, Peter Zijlstra wrote:
>
> 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 :/

Hmm, I was hoping to be able to see if it was this_load or the
effective_load() result being silly large, but going by the ASM output
of my compiler this isn't going to be available in registers, its all
stack spills.

Pinning my hopes on that reproducability thing :/