diff options
| author | Vladimir Davydov <[email protected]> | 2014-01-21 15:49:41 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2014-01-21 16:19:45 -0800 |
| commit | 1c98dd905ddb7552f13a3f06aa0bd9ef6affeeb7 (patch) | |
| tree | 6c977f0566e6ef99ac45547a3c81017a575cd73c /scripts/objdiff | |
| parent | b2f3eebe7a8ef6cd4e2ea088ac7f613793f6cad6 (diff) | |
memcg: fix kmem_account_flags check in memcg_can_account_kmem()
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.
This means that a page might get charged by memcg_kmem_newpage_charge
which would see its static key patched already but
memcg_kmem_commit_charge would still see it unpatched and so the charge
won't be committed. The result would be charge inconsistency
(page_cgroup not marked as PageCgroupUsed) and the charge would leak
because __memcg_kmem_uncharge_pages would ignore it.
[[email protected]: augment changelog]
Signed-off-by: Vladimir Davydov <[email protected]>
Cc: Johannes Weiner <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Balbir Singh <[email protected]>
Cc: KAMEZAWA Hiroyuki <[email protected]>
Cc: Glauber Costa <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions