From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch V2 11/24] ARM/hw_breakpoint: Use cpuhp_setup_state_cpuslocked()
Date: Wed, 19 Apr 2017 20:20:24 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1704192019500.1933@nanos> (raw)
In-Reply-To: <20170419175454.GM27829@leverpostej>
On Wed, 19 Apr 2017, Mark Rutland wrote:
> Hi,
>
> On Tue, Apr 18, 2017 at 07:04:53PM +0200, Thomas Gleixner wrote:
> > From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> >
> > arch_hw_breakpoint_init() holds get_online_cpus() while registerring the
> > hotplug callbacks.
> >
> > cpuhp_setup_state() invokes get_online_cpus() as well. This is correct, but
> > prevents the conversion of the hotplug locking to a percpu rwsem.
> >
> > Use cpuhp_setup_state_cpuslocked() to avoid the nested call.
> >
> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Will Deacon <will.deacon@arm.com>
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: Russell King <linux@armlinux.org.uk>
> > Cc: linux-arm-kernel at lists.infradead.org
> >
> > ---
> > arch/arm/kernel/hw_breakpoint.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > --- a/arch/arm/kernel/hw_breakpoint.c
> > +++ b/arch/arm/kernel/hw_breakpoint.c
> > @@ -1098,8 +1098,9 @@ static int __init arch_hw_breakpoint_ini
> > * assume that a halting debugger will leave the world in a nice state
> > * for us.
> > */
> > - ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "arm/hw_breakpoint:online",
> > - dbg_reset_online, NULL);
> > + ret = cpuhp_setup_state_cpuslocked(CPUHP_AP_ONLINE_DYN,
> > + "arm/hw_breakpoint:online",
> > + dbg_reset_online, NULL);
>
> Given the callsite, this particular change looks ok to me. So FWIW:
>
> Acked-by: Mark Rutland <mark.rutland@arm.com>
>
> However, as a more general note, the changes make the API feel odd. per
> their current names, {get,put}_online_cpus() sound/feel like refcounting
> ops, which should be able to nest.
>
> Is there any chance these could get a better name, e.g.
> {lock,unlock}_online_cpus(), so as to align with _cpuslocked?
Yes, that's a follow up cleanup patch treewide once this hit Linus tree.
Thanks,
tglx
next prev parent reply other threads:[~2017-04-19 18:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170418170442.665445272@linutronix.de>
2017-04-18 17:04 ` [patch V2 08/24] hwtracing/coresight-etm3x: Use cpuhp_setup_state_nocalls_cpuslocked() Thomas Gleixner
2017-04-20 15:14 ` Mathieu Poirier
2017-04-20 15:32 ` Mathieu Poirier
2017-04-18 17:04 ` [patch V2 09/24] hwtracing/coresight-etm4x: " Thomas Gleixner
2017-04-18 17:04 ` [patch V2 11/24] ARM/hw_breakpoint: Use cpuhp_setup_state_cpuslocked() Thomas Gleixner
2017-04-19 17:54 ` Mark Rutland
2017-04-19 18:20 ` Thomas Gleixner [this message]
2017-04-25 16:10 ` [patch V2 00/24] cpu/hotplug: Convert get_online_cpus() to a percpu_rwsem Mark Rutland
2017-04-25 17:28 ` Sebastian Siewior
2017-04-26 8:59 ` Mark Rutland
2017-04-26 9:40 ` Suzuki K Poulose
2017-04-26 10:32 ` Mark Rutland
2017-04-27 8:27 ` Sebastian Siewior
2017-04-27 9:57 ` Mark Rutland
2017-04-27 10:01 ` Thomas Gleixner
2017-04-27 12:30 ` Mark Rutland
2017-04-27 15:48 ` [PATCH] arm64: cpufeature: use static_branch_enable_cpuslocked() (was: Re: [patch V2 00/24] cpu/hotplug: Convert get_online_cpus() to a percpu_rwsem) Mark Rutland
2017-04-27 16:35 ` Suzuki K Poulose
2017-04-27 17:03 ` [PATCH] arm64: cpufeature: use static_branch_enable_cpuslocked() Suzuki K Poulose
2017-04-27 17:17 ` Mark Rutland
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=alpine.DEB.2.20.1704192019500.1933@nanos \
--to=tglx@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox