LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: David Hildenbrand <dahi@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, heiko.carstens@de.ibm.com,
borntraeger@de.ibm.com, rafael.j.wysocki@intel.com,
peterz@infradead.org, srivatsa.bhat@linux.vnet.ibm.com,
oleg@redhat.com, bp@suse.de, jkosina@suse.cz
Subject: Re: [PATCH v1] CPU hotplug: active_reader not woken up in some cases - deadlock
Date: Mon, 8 Dec 2014 12:47:17 -0800 [thread overview]
Message-ID: <20141208204716.GT25340@linux.vnet.ibm.com> (raw)
In-Reply-To: <20141208203018.24f23bdb@thinkpad-w530>
On Mon, Dec 08, 2014 at 08:30:18PM +0100, David Hildenbrand wrote:
> > > active_writer is cleared while holding cpuhp_lock, so this should be safe,
> > > right?
> >
> > You lost me on that one. Don't we get to that piece of code precisely
> > because we don't hold any of the CPU-hotplug locks? If so, the
> > writer might well hold all the locks it needs, and might well change
> > cpu_hotplug.active_writer out from under us.
> >
> > What am I missing here?
> >
> > Thanx, Paul
>
> I was missing that cpuhp_lock_* are simply lockdep anotations ... it's
> getting late :)
>
> So you're right, we need to verify that we don't get a 0 on the second access.
All you should need to do is to do something like this:
awp = ACCESS_ONCE(cpu_hotplug.active_writer);
if (awp)
wake_up_process(cpu_hotplug.active_writer);
That way you only have one access, and the check and wake_up_process()
are guaranteed to be consistent.
> Will send an updated version soon.
Sounds good!
Thanx, Paul
prev parent reply other threads:[~2014-12-08 23:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-08 18:13 David Hildenbrand
2014-12-08 18:15 ` David Hildenbrand
2014-12-08 18:31 ` Paul E. McKenney
2014-12-08 18:58 ` David Hildenbrand
2014-12-08 19:08 ` Paul E. McKenney
2014-12-08 19:30 ` David Hildenbrand
2014-12-08 20:47 ` Paul E. McKenney [this message]
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=20141208204716.GT25340@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=bp@suse.de \
--cc=dahi@linux.vnet.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=srivatsa.bhat@linux.vnet.ibm.com \
--subject='Re: [PATCH v1] CPU hotplug: active_reader not woken up in some cases - deadlock' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).