OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 0/3] Fix problem with static_key decrement
Re: [PATCH 0/3] Fix problem with static_key decrement [message #45969 is a reply to message #45948] Fri, 20 April 2012 15:01 Go to previous message
Glauber Costa is currently offline  Glauber Costa
Messages: 916
Registered: October 2011
Senior Member
On 04/19/2012 07:54 PM, Tejun Heo wrote:
> On Thu, Apr 19, 2012 at 07:49:15PM -0300, Glauber Costa wrote:
>> Hi,
>>
>> This is my proposed fix for the sock memcg static_key
>> problem raised by Kamezawa. It works for me, but I would
>> Kame, please confirm.
>
> Please detail the problem. I don't follow what's the purpose here.
>

Ok.

1) Kame found the following bug: we were decrementing the jump label
when the socket limit was set back to unlimited. The problem is that the
sockets outlive the memcg, so we can only do that when the last
reference count is dropped. It is worth mentioning that kmem controller
for memcg will have the exact same problem - I am actually updating my
series with all the results of this discussion here.

2) If, however, there are no sockets in flight, mem_cgroup_put() during
->destroy() will be the last one, and the decrementing will happen there.

3) static_key updates cannot happen with the cgroup_mutex held. This is
because cpusets hold it from within the cpu_hotplug.lock - that
static_keys take through get_online_cpus() in its cpu hotplug handler.

4) Looking at the cpusets code, it really seems necessary, at least by now.

5) Deferring all this to worker threads as you suggested in the cpu
thread - that has a similar problem - can solve this problem, but in
general, will create tons of others, like windows of inconsistent
information.

That's basically it.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH 3/3] SUNRPC: set per-net PipeFS superblock before notification
Next Topic: [PATCH v2 0/5] Fix problem with static_key decrement
Goto Forum:
  


Current Time: Fri Sep 12 12:50:09 GMT 2025

Total time taken to generate the page: 0.07581 seconds