lkml.org 
[lkml]   [2011]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] sched: Fix "divide error: 0000" in find_busiest_group


On 07/19/2011 03:18 PM, Peter Zijlstra wrote:
> 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.
>
This x86_64. This is the actual cause, unless the rq->clock
value should never roll, in which case, the clock roll is the
actual cause and you can disregard these patches.

-T
>> 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
>
>
>


\
 
 \ /
  Last update: 2011-07-20 00:23    [from the cache]
©2003-2011 Jasper Spaans