Re: [PATCH] memcg: fix kmem_account_flags check in memcg_can_account_kmem()

2013-11-29 Thread Vladimir Davydov
On 11/29/2013 01:45 PM, Michal Hocko wrote: On Wed 27-11-13 19:46:01, Vladimir Davydov wrote: We should start kmem accounting for a memory cgroup only after both its kmem limit is set (KMEM_ACCOUNTED_ACTIVE) and related call sites are patched (KMEM_ACCOUNTED_ACTIVATED). This should be

Re: [PATCH] memcg: fix kmem_account_flags check in memcg_can_account_kmem()

2013-11-29 Thread Michal Hocko
On Wed 27-11-13 19:46:01, Vladimir Davydov wrote: > We should start kmem accounting for a memory cgroup only after both its > kmem limit is set (KMEM_ACCOUNTED_ACTIVE) and related call sites are > patched (KMEM_ACCOUNTED_ACTIVATED). This should be vice-versa, no? ACTIVE is set after

Re: [PATCH] memcg: fix kmem_account_flags check in memcg_can_account_kmem()

2013-11-29 Thread Michal Hocko
On Wed 27-11-13 19:46:01, Vladimir Davydov wrote: We should start kmem accounting for a memory cgroup only after both its kmem limit is set (KMEM_ACCOUNTED_ACTIVE) and related call sites are patched (KMEM_ACCOUNTED_ACTIVATED). This should be vice-versa, no? ACTIVE is set after

Re: [PATCH] memcg: fix kmem_account_flags check in memcg_can_account_kmem()

2013-11-29 Thread Vladimir Davydov
On 11/29/2013 01:45 PM, Michal Hocko wrote: On Wed 27-11-13 19:46:01, Vladimir Davydov wrote: We should start kmem accounting for a memory cgroup only after both its kmem limit is set (KMEM_ACCOUNTED_ACTIVE) and related call sites are patched (KMEM_ACCOUNTED_ACTIVATED). This should be

[PATCH] memcg: fix kmem_account_flags check in memcg_can_account_kmem()

2013-11-27 Thread Vladimir Davydov
We should start kmem accounting for a memory cgroup only after both its kmem limit is set (KMEM_ACCOUNTED_ACTIVE) and related call sites are patched (KMEM_ACCOUNTED_ACTIVATED). Currently memcg_can_account_kmem() allows kmem accounting even if only one of the conditions is true. Fix it.

[PATCH] memcg: fix kmem_account_flags check in memcg_can_account_kmem()

2013-11-27 Thread Vladimir Davydov
We should start kmem accounting for a memory cgroup only after both its kmem limit is set (KMEM_ACCOUNTED_ACTIVE) and related call sites are patched (KMEM_ACCOUNTED_ACTIVATED). Currently memcg_can_account_kmem() allows kmem accounting even if only one of the conditions is true. Fix it.