Thread (75 messages) 75 messages, 10 authors, 2012-11-14

Re: [PATCH v6 23/29] memcg: destroy memcg caches

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2012-11-02 00:05:53
Also in: lkml

On Thu,  1 Nov 2012 16:07:39 +0400
Glauber Costa [off-list ref] wrote:
quoted hunk ↗ jump to hunk
This patch implements destruction of memcg caches. Right now,
only caches where our reference counter is the last remaining are
deleted. If there are any other reference counters around, we just
leave the caches lying around until they go away.

When that happen, a destruction function is called from the cache
code. Caches are only destroyed in process context, so we queue them
up for later processing in the general case.


...
@@ -5950,6 +6012,7 @@ static int mem_cgroup_pre_destroy(struct cgroup *cont)
 {
 	struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
 
+	mem_cgroup_destroy_all_caches(memcg);
 	return mem_cgroup_force_empty(memcg, false);
 }
 
Conflicts with linux-next cgroup changes.  Looks pretty simple:


static int mem_cgroup_pre_destroy(struct cgroup *cont)
{
	struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
	int ret;

	css_get(&memcg->css);
	ret = mem_cgroup_reparent_charges(memcg);
	mem_cgroup_destroy_all_caches(memcg);
	css_put(&memcg->css);

	return ret;
}

--
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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help