Skip to content

Commit

Permalink
memcg: do not account memory used for cache creation
Browse files Browse the repository at this point in the history
The memory we used to hold the memcg arrays is currently accounted to
the current memcg.  But that creates a problem, because that memory can
only be freed after the last user is gone.  Our only way to know which
is the last user, is to hook up to freeing time, but the fact that we
still have some in flight kmallocs will prevent freeing to happen.  I
believe therefore to be just easier to account this memory as global
overhead.

Signed-off-by: Glauber Costa <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Kamezawa Hiroyuki <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
glommer authored and torvalds committed Jul 9, 2013
1 parent 6d42c23 commit 425c598
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -5232,7 +5232,9 @@ static int memcg_propagate_kmem(struct mem_cgroup *memcg)
static_key_slow_inc(&memcg_kmem_enabled_key);

mutex_lock(&set_limit_mutex);
memcg_stop_kmem_account();
ret = memcg_update_cache_sizes(memcg);
memcg_resume_kmem_account();
mutex_unlock(&set_limit_mutex);
out:
return ret;
Expand Down

0 comments on commit 425c598

Please sign in to comment.