linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Avoiding expensive reference counting in charge page path
@ 2012-08-14 10:58 Glauber Costa
  2012-08-14 10:58 ` [PATCH 1/2] return amount of charges after res_counter_uncharge Glauber Costa
  2012-08-14 10:58 ` [PATCH 2/2] Avoid doing a get/put pair in every kmemcg charge Glauber Costa
  0 siblings, 2 replies; 3+ messages in thread
From: Glauber Costa @ 2012-08-14 10:58 UTC (permalink / raw)
  To: linux-mm
  Cc: cgroups, kamezawa.hiroyu, Michal Hocko, Johannes Weiner,
	Greg Thelen, Frederic Weisbecker

Hi,

In my last submission for the kmem controller for memcg, Kame noted that the
way we use to guarantee that the memcg will still be around while there are
charges is quite expensive: we issue mem_cgroup_get() in every charge, that is
countered by mem_cgroup_put() in every uncharge.

I am trying an alternate way through the two patches that follow. The idea is to
only call mem_cgroup_get() when the first charge happens. We'll use a bit in the
kmem_accounted bitmap for that: we have plenty.

We allow the allocations to continue paying only the cost of a likely branch
over a simple test after that. We also note through another bit the destruction
of that group. When charges get down to 0 after destruction, we then proceed
to release the reference.

I am sending those two patches separately so they get reviewed on their own.
If nobody opposes, I'll add them ontop of the current kmem patches.

Thanks.

Glauber Costa (2):
  return amount of charges after res_counter_uncharge
  Avoid doing a get/put pair in every kmemcg charge

 Documentation/cgroups/resource_counter.txt |  7 ++--
 include/linux/res_counter.h                | 12 ++++---
 kernel/res_counter.c                       | 20 +++++++----
 mm/memcontrol.c                            | 57 ++++++++++++++++++++++++++----
 4 files changed, 74 insertions(+), 22 deletions(-)

-- 
1.7.11.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-14 11:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-14 10:58 [PATCH 0/2] Avoiding expensive reference counting in charge page path Glauber Costa
2012-08-14 10:58 ` [PATCH 1/2] return amount of charges after res_counter_uncharge Glauber Costa
2012-08-14 10:58 ` [PATCH 2/2] Avoid doing a get/put pair in every kmemcg charge Glauber Costa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox