Re: [PATCH] static_key: fix concurrent static_key_slow_inc

2016-06-22 Thread Paolo Bonzini
On 22/06/2016 10:50, Christian Borntraeger wrote: > On 06/21/2016 06:52 PM, Paolo Bonzini wrote: >> The following scenario is possible: >> >> CPU 1 CPU 2 >> static_key_slow_inc >> atomic_inc_not_zero >> -> key.enabled == 0, no increment >>

Re: [PATCH] static_key: fix concurrent static_key_slow_inc

2016-06-22 Thread Christian Borntraeger
On 06/21/2016 06:52 PM, Paolo Bonzini wrote: > The following scenario is possible: > > CPU 1 CPU 2 > static_key_slow_inc > atomic_inc_not_zero > -> key.enabled == 0, no increment > jump_label_lock > atomic_inc_return > -> key.ena

Re: [PATCH] static_key: fix concurrent static_key_slow_inc

2016-06-21 Thread Peter Zijlstra
On Tue, Jun 21, 2016 at 06:52:17PM +0200, Paolo Bonzini wrote: > The following scenario is possible: > > CPU 1 CPU 2 > static_key_slow_inc > atomic_inc_not_zero > -> key.enabled == 0, no increment > jump_label_lock > atomic_inc_return

[PATCH] static_key: fix concurrent static_key_slow_inc

2016-06-21 Thread Paolo Bonzini
The following scenario is possible: CPU 1 CPU 2 static_key_slow_inc atomic_inc_not_zero -> key.enabled == 0, no increment jump_label_lock atomic_inc_return -> key.enabled == 1 now stati