Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Mark Rutland
On Thu, May 11, 2017 at 05:08:19PM +0100, Marc Zyngier wrote: > On 11/05/17 16:54, Suzuki K Poulose wrote: > > On 11/05/17 16:37, Mark Rutland wrote: > >> On Thu, May 11, 2017 at 04:15:38PM +0100, Suzuki K Poulose wrote: > >>> On 11/05/17 16:01, Mark Rutland wrote: > +static inline bool

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Mark Rutland
On Thu, May 11, 2017 at 05:08:19PM +0100, Marc Zyngier wrote: > On 11/05/17 16:54, Suzuki K Poulose wrote: > > On 11/05/17 16:37, Mark Rutland wrote: > >> On Thu, May 11, 2017 at 04:15:38PM +0100, Suzuki K Poulose wrote: > >>> On 11/05/17 16:01, Mark Rutland wrote: > +static inline bool

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Marc Zyngier
On 11/05/17 16:54, Suzuki K Poulose wrote: > On 11/05/17 16:37, Mark Rutland wrote: >> On Thu, May 11, 2017 at 04:15:38PM +0100, Suzuki K Poulose wrote: >>> On 11/05/17 16:01, Mark Rutland wrote: +static inline bool cpus_have_const_cap(int num) +{ + if

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Marc Zyngier
On 11/05/17 16:54, Suzuki K Poulose wrote: > On 11/05/17 16:37, Mark Rutland wrote: >> On Thu, May 11, 2017 at 04:15:38PM +0100, Suzuki K Poulose wrote: >>> On 11/05/17 16:01, Mark Rutland wrote: +static inline bool cpus_have_const_cap(int num) +{ + if

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Suzuki K Poulose
On 11/05/17 16:37, Mark Rutland wrote: On Thu, May 11, 2017 at 04:15:38PM +0100, Suzuki K Poulose wrote: On 11/05/17 16:01, Mark Rutland wrote: +static inline bool cpus_have_const_cap(int num) +{ + if (static_branch_likely(_const_caps_ready)) + return

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Suzuki K Poulose
On 11/05/17 16:37, Mark Rutland wrote: On Thu, May 11, 2017 at 04:15:38PM +0100, Suzuki K Poulose wrote: On 11/05/17 16:01, Mark Rutland wrote: +static inline bool cpus_have_const_cap(int num) +{ + if (static_branch_likely(_const_caps_ready)) + return

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Mark Rutland
On Thu, May 11, 2017 at 04:37:20PM +0100, Mark Rutland wrote: > On Thu, May 11, 2017 at 04:15:38PM +0100, Suzuki K Poulose wrote: > > On 11/05/17 16:01, Mark Rutland wrote: > > >+static inline bool cpus_have_const_cap(int num) > > >+{ > > >+ if (static_branch_likely(_const_caps_ready)) > > >+

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Mark Rutland
On Thu, May 11, 2017 at 04:37:20PM +0100, Mark Rutland wrote: > On Thu, May 11, 2017 at 04:15:38PM +0100, Suzuki K Poulose wrote: > > On 11/05/17 16:01, Mark Rutland wrote: > > >+static inline bool cpus_have_const_cap(int num) > > >+{ > > >+ if (static_branch_likely(_const_caps_ready)) > > >+

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Mark Rutland
On Thu, May 11, 2017 at 04:15:38PM +0100, Suzuki K Poulose wrote: > On 11/05/17 16:01, Mark Rutland wrote: > >+static inline bool cpus_have_const_cap(int num) > >+{ > >+if (static_branch_likely(_const_caps_ready)) > >+return __cpus_have_const_cap(num); > >+else > >+

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Mark Rutland
On Thu, May 11, 2017 at 04:15:38PM +0100, Suzuki K Poulose wrote: > On 11/05/17 16:01, Mark Rutland wrote: > >+static inline bool cpus_have_const_cap(int num) > >+{ > >+if (static_branch_likely(_const_caps_ready)) > >+return __cpus_have_const_cap(num); > >+else > >+

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Suzuki K Poulose
On 11/05/17 16:01, Mark Rutland wrote: Currently, cpus_set_cap() calls static_branch_enable_cpuslocked(), which must take the jump_label mutex. We call cpus_set_cap() in the secondary bringup path, from the idle thread where interrupts are disabled. Taking a mutex in this path "is a NONO"

Re: [PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Suzuki K Poulose
On 11/05/17 16:01, Mark Rutland wrote: Currently, cpus_set_cap() calls static_branch_enable_cpuslocked(), which must take the jump_label mutex. We call cpus_set_cap() in the secondary bringup path, from the idle thread where interrupts are disabled. Taking a mutex in this path "is a NONO"

[PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Mark Rutland
Currently, cpus_set_cap() calls static_branch_enable_cpuslocked(), which must take the jump_label mutex. We call cpus_set_cap() in the secondary bringup path, from the idle thread where interrupts are disabled. Taking a mutex in this path "is a NONO" regardless of whether it's contended, and

[PATCHv2] arm64/cpufeature: don't use mutex in bringup path

2017-05-11 Thread Mark Rutland
Currently, cpus_set_cap() calls static_branch_enable_cpuslocked(), which must take the jump_label mutex. We call cpus_set_cap() in the secondary bringup path, from the idle thread where interrupts are disabled. Taking a mutex in this path "is a NONO" regardless of whether it's contended, and