From: Peter Zijlstra <peterz@infradead.org>
To: Venkatesh Pallipadi <venki@google.com>
Cc: Chetan Ahuja <chetan.ahuja@gmail.com>,
linux-kernel@vger.kernel.org,
Suresh Siddha <suresh.b.siddha@intel.com>
Subject: Re: divide by zero bug in find_busiest_group
Date: Fri, 27 Aug 2010 10:08:34 +0200 [thread overview]
Message-ID: <1282896514.1975.1748.camel@laptop> (raw)
In-Reply-To: <AANLkTim75Z-X--LDJX8MLYF8G=vPW_GniVFQrkL7QoAy@mail.gmail.com>
On Thu, 2010-08-26 at 12:19 -0700, Venkatesh Pallipadi wrote:
> > There's also another place group->cpu_power values gets updated
> > without any synchronization, in
> > the update_cpu_power function. Though the only way this could result
> > in a bad value for cpu_power
> > is by core A reading an in-transit value for a non-atomically-updated
> > 64 bit value from core B :-). Unlikely ?
> > Very !!. Should we make that update explicity atomic ? Would be prudent.
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.
next prev parent reply other threads:[~2010-08-27 8:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-26 1:17 Chetan Ahuja
2010-08-26 19:19 ` Venkatesh Pallipadi
2010-08-26 23:52 ` Chetan Ahuja
2010-08-27 7:51 ` Peter Zijlstra
2010-08-27 8:13 ` Peter Zijlstra
2010-08-27 17:39 ` Venkatesh Pallipadi
2010-08-27 8:08 ` Peter Zijlstra [this message]
2010-09-15 20:29 Joe Williams
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=1282896514.1975.1748.camel@laptop \
--to=peterz@infradead.org \
--cc=chetan.ahuja@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=suresh.b.siddha@intel.com \
--cc=venki@google.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
all inboxes | Powered by JetHome®