Re: divide by zero bug in find_busiest_group

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Friday, August 27, 2010 - 1:08 am

On Thu, 2010-08-26 at 12:19 -0700, Venkatesh Pallipadi wrote:

struct sched_group {
	...
        unsigned int cpu_power, cpu_power_orig;
	...
}

we assume that things are naturally aligned and reads/writes to word
sized entities are 'atomic' -- lots of kernel code makes this
assumption.

So the worst thing that can happen with the unsynchronized update of
cpu_power is that a reader sees the old value, no problem, we don't care
its all statistics anyway. Racing writers (could happen between regular
and nohz load-balance) we don't care about either, since the result is
either one or the other, not a mixture of both.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
divide by zero bug in find_busiest_group, Chetan Ahuja, (Wed Aug 25, 6:17 pm)
Re: divide by zero bug in find_busiest_group, Venkatesh Pallipadi, (Thu Aug 26, 12:19 pm)
Re: divide by zero bug in find_busiest_group, Chetan Ahuja, (Thu Aug 26, 4:52 pm)
Re: divide by zero bug in find_busiest_group, Peter Zijlstra, (Fri Aug 27, 12:51 am)
Re: divide by zero bug in find_busiest_group, Peter Zijlstra, (Fri Aug 27, 1:08 am)
Re: divide by zero bug in find_busiest_group, Peter Zijlstra, (Fri Aug 27, 1:13 am)
Re: divide by zero bug in find_busiest_group, Venkatesh Pallipadi, (Fri Aug 27, 10:39 am)