From: Peter Zijlstra <peterz@infradead.org>
To: Terry Loftin <terry.loftin@hp.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Bob Montgomery <bob.montgomery@hp.com>
Subject: Re: [PATCH 1/2] sched: Fix "divide error: 0000" in find_busiest_group
Date: Wed, 20 Jul 2011 00:30:21 +0200 [thread overview]
Message-ID: <1311114621.2617.7.camel@laptop> (raw)
In-Reply-To: <4E26032D.3070006@hp.com>
On Tue, 2011-07-19 at 16:20 -0600, Terry Loftin wrote:
> On 07/19/2011 03:17 PM, Peter Zijlstra wrote:
> > On Tue, 2011-07-19 at 14:58 -0600, Terry Loftin wrote:
> >> Correct the protection expression in update_cpu_power() to avoid setting
> >> rq->cpu_power to zero.
> >
> > Firstly you fail to mention what kernel this is again, secondly this
> > should never happen in the first place, so this fix is wrong. At best it
> > papers over another bug.
>
> My Apologies, this was found on kernel 2.6.32.32, but the all
> the related code is the same in v3.0-rc7. The patch is against
> v3.0-rc7. I've done some limited testing of this on 2.6.32.32
> by modifying __cycles_2_ns() to add an offset to the TSC when
> it is read to simulate 208 days of uptime, but that kernel has
> only been running for a couple days.
>
> I also agree this should never happen. As the statement currently
> stands, it won't work - so it should either be corrected or removed.
> Here is the alternative patch:
>
> - if (!power)
> - power = 1;
IIRC it can actually end up being 0 if the scale factors are small
enough, but what I couldn't see happening is how it can be > 2^32, which
is required for your initial patch to make a difference.
In that case the scale factors were _way_ out of bound, they're supposed
to be [0,SCHED_POWER_SCALE] and since we divide by SCHED_POWER_SCALE
after every factor the result should remain in that range.
Now clearly you've found that going haywire, so we need to find where
and why that happens and cure that.
next prev parent reply other threads:[~2011-07-19 22:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-19 20:58 [PATCH 1/2] sched: Fix "divide error: 0000" in find_busiest_group Terry Loftin
2011-07-19 21:17 ` Peter Zijlstra
2011-07-19 22:20 ` Terry Loftin
2011-07-19 22:30 ` Peter Zijlstra [this message]
2011-07-20 2:26 ` Mike Galbraith
2011-07-20 2:29 ` Peter Zijlstra
2011-07-20 3:32 ` Mike Galbraith
2011-09-01 17:16 ` Simon Kirby
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=1311114621.2617.7.camel@laptop \
--to=peterz@infradead.org \
--cc=bob.montgomery@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=terry.loftin@hp.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