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 2/2] sched: Fix "divide error: 0000" in find_busiest_group
Date: Tue, 19 Jul 2011 23:18:10 +0200 [thread overview]
Message-ID: <1311110290.2617.3.camel@laptop> (raw)
In-Reply-To: <4E25F009.1040309@hp.com>
On Tue, 2011-07-19 at 14:58 -0600, Terry Loftin wrote:
> Add a check to sched_avg_update() to detect and reset age_stamp if the
> clock value has wrapped. Because __cycles_2_ns() includes an offset
> to account for start up time, the clock may not wrap to zero, so use
> the current clock value instead.
So you're running on a platform (unspecified) where we use a raw
sched_clock() that is buggy. Again, you're fixing symptoms not causes.
> Signed-off-by: Terry Loftin <terry.loftin@hp.com>
> Signed-off-by: Bob Montgomery <bob.montgomery@hp.com>
> ---
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 18d38e4..b39cae1 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -1256,6 +1256,8 @@ static void sched_avg_update(struct rq *rq)
> {
> s64 period = sched_avg_period();
>
> + if (unlikely(rq->age_stamp > rq->clock))
> + rq->age_stamp = rq->clock;
> while ((s64)(rq->clock - rq->age_stamp) > period) {
> /*
> * Inline assembly required to prevent the compiler
next prev parent reply other threads:[~2011-07-19 21:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-19 20:58 [PATCH 2/2] sched: Fix "divide error: 0000" in find_busiest_group Terry Loftin
2011-07-19 21:18 ` Peter Zijlstra [this message]
2011-07-19 22:21 ` Terry Loftin
2011-07-19 22:33 ` Peter Zijlstra
2011-07-19 22:39 ` Terry Loftin
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=1311110290.2617.3.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