OpenVZ Forum


Home » Mailing lists » Devel » [PATCH v3 2/2] decrement static keys on real destroy time
Re: [PATCH v3 2/2] decrement static keys on real destroy time [message #46135 is a reply to message #46134] Thu, 26 April 2012 22:22 Go to previous messageGo to previous message
Tejun Heo is currently offline  Tejun Heo
Messages: 184
Registered: November 2006
Senior Member
Hello,

On Thu, Apr 26, 2012 at 3:17 PM, Glauber Costa <glommer@parallels.com> wrote:
>
>> No, what I mean is that why can't you do about the same mutexed
>> activated inside static_key API function instead of requiring every
>> user to worry about the function returning asynchronously.
>> ie. synchronize inside static_key API instead of in the callers.
>>
>
> Like this?

Yeah, something like that. If keeping the inc operation a single
atomic op is important for performance or whatever reasons, you can
play some trick with large negative bias value while activation is
going on and use atomic_add_return() to determine both whether it's
the first incrementer and someone else is in the process of
activating.

Thanks.

--
tejun
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH v3 0/2] fix problem with static_branch() for sock memcg
Next Topic: [PATCH 2/3] SUNRPC: traverse clients tree on PipeFS event
Goto Forum:
  


Current Time: Mon Aug 04 10:52:24 GMT 2025

Total time taken to generate the page: 2.26491 seconds