[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170426103236.GI27156@leverpostej>
Date: Wed, 26 Apr 2017 11:32:36 +0100
From: Mark Rutland <mark.rutland@....com>
To: Suzuki K Poulose <Suzuki.Poulose@....com>
Cc: Sebastian Siewior <bigeasy@...utronix.de>, catalin.marinas@....com,
will.deacon@....com, Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [patch V2 00/24] cpu/hotplug: Convert get_online_cpus() to a
percpu_rwsem
On Wed, Apr 26, 2017 at 10:40:47AM +0100, Suzuki K Poulose wrote:
> On 26/04/17 09:59, Mark Rutland wrote:
> >We only call cpus_set_cap() in the secondary boot path, where we know
> >that the rwsem is held by the thread orchestrating the onlining. Thus,
> >we can use the new static_branch_enable_cpuslocked() in cpus_set_cap(),
> >avoiding the above.
>
> Correction, we could call cpus_set_cap() from setup_cpu_features()
> for updating the system global capabilities, where we may not hold the
> cpu_hotplug_lock.
Argh, yes, I missed that when scanning.
> So we could end up calling static_branch_enable_cpuslocked()
> without actually holding the lock. Should we do a cpu_hotplug_begin/done in
> setup_cpu_feature_capabilities ? I agree it doesn't look that nice. Thoughts ?
I agree that's hideous, but it looks like the only choice given the
hotplug rwsem cahnges. :/
I can spin a v2 with that and the typo fixes.
Thanks,
Mark.
>
> Suzuki
>
> >
> >Signed-off-by: Mark Rutland <mark.rutland@....com>
> >Reported-by: Catalin Marinas <catalin.marinas@....com>
> >Suggested-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> >Cc: Will Deacon <will.deacon@....com>
> >Cc: Suzuki Poulose <suzuki,poulose@....com>
> >---
> > arch/arm64/include/asm/cpufeature.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
> >index f31c48d..349b5cd 100644
> >--- a/arch/arm64/include/asm/cpufeature.h
> >+++ b/arch/arm64/include/asm/cpufeature.h
> >@@ -145,7 +145,7 @@ static inline void cpus_set_cap(unsigned int num)
> > num, ARM64_NCAPS);
> > } else {
> > __set_bit(num, cpu_hwcaps);
> >- static_branch_enable(&cpu_hwcap_keys[num]);
> >+ static_branch_enable_cpuslocked(&cpu_hwcap_keys[num]);
> > }
> > }
> >
> >
>
Powered by blists - more mailing lists