From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Borislav Petkov <bp@amd64.org>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
tony.luck@intel.com, tglx@linutronix.de, mingo@elte.hu,
hpa@zytor.com, x86@kernel.org, linux-edac@vger.kernel.org,
linux-kernel@vger.kernel.org, marcos.mage@gmail.com,
prasad@linux.vnet.ibm.com
Subject: Re: [PATCH] x86, mce: Fix rcu splat in drain_mce_log_buffer()
Date: Sun, 12 Feb 2012 09:41:33 -0800 [thread overview]
Message-ID: <20120212174133.GL3737@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120206161802.GC31237@aftab>
On Mon, Feb 06, 2012 at 05:18:02PM +0100, Borislav Petkov wrote:
> On Fri, Jan 13, 2012 at 01:44:35PM -0800, Paul E. McKenney wrote:
> > Looks good to me, but I do need to defer to people who know this code
> > better than do I. The key thing that (from what I can see) makes
> > rcu_dereference() unnecessary is that the smp_rmb() used in conjunction
> > with polling the .finished field takes care of ordering.
>
> Right, this was me trying hard not to screw up touching mcelog.next,
> thus trying to use the rcu_dereference_index_check() primitive without
> thinking it through too much. But you're right, I'm polling the
> ->finished field 4 times (totally arbitrary, btw) which should suffice
> while the mce_log() routine above writes those entries.
>
> Although, the question still remains, since mce_log() accesses
> mcelog.next through the rcu_dereference_index_check() primitive,
> shouldn't I do it the same way?
I don't claim to be an mce_log() expert, but when I looked it over,
I didn't see a need for rcu_dereference_index_check(). Unless I am
confused (quite possible), the memory barriers are sufficient.
The rcu_read_lock() and rcu_read_unlock() seem to be needed to avoid
premature freeing, though.
Thanx, Paul
next prev parent reply other threads:[~2012-02-12 17:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-11 14:24 [PATCH] x86, mce: Fix rcu splat in drain_mce_log_buffer() Srivatsa S. Bhat
2012-01-11 16:11 ` Paul E. McKenney
2012-01-13 12:28 ` Srivatsa S. Bhat
2012-01-13 21:44 ` Paul E. McKenney
2012-01-26 16:02 ` Srivatsa S. Bhat
2012-02-06 16:18 ` Borislav Petkov
2012-02-12 17:41 ` Paul E. McKenney [this message]
2012-02-16 10:17 ` Borislav Petkov
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=20120212174133.GL3737@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=bp@amd64.org \
--cc=hpa@zytor.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcos.mage@gmail.com \
--cc=mingo@elte.hu \
--cc=prasad@linux.vnet.ibm.com \
--cc=srivatsa.bhat@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.