Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127601
b: refs/heads/master
c: a7ba0ee
h: refs/heads/master
i:
  127599: 792825c
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Jan 8, 2009
1 parent a0584b8 commit 861a189
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03f3c433648a97ae7c86be789edba67690f6ea60
refs/heads/master: a7ba0eef3af51cd1b6fc4028e4705b3ea2ea9469
21 changes: 6 additions & 15 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2092,14 +2092,10 @@ static struct mem_cgroup *mem_cgroup_alloc(void)
* Removal of cgroup itself succeeds regardless of refs from swap.
*/

static void mem_cgroup_free(struct mem_cgroup *mem)
static void __mem_cgroup_free(struct mem_cgroup *mem)
{
int node;

if (atomic_read(&mem->refcnt) > 0)
return;


for_each_node_state(node, N_POSSIBLE)
free_mem_cgroup_per_zone_info(mem, node);

Expand All @@ -2116,11 +2112,8 @@ static void mem_cgroup_get(struct mem_cgroup *mem)

static void mem_cgroup_put(struct mem_cgroup *mem)
{
if (atomic_dec_and_test(&mem->refcnt)) {
if (!mem->obsolete)
return;
mem_cgroup_free(mem);
}
if (atomic_dec_and_test(&mem->refcnt))
__mem_cgroup_free(mem);
}


Expand Down Expand Up @@ -2170,12 +2163,10 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)

if (parent)
mem->swappiness = get_swappiness(parent);

atomic_set(&mem->refcnt, 1);
return &mem->css;
free_out:
for_each_node_state(node, N_POSSIBLE)
free_mem_cgroup_per_zone_info(mem, node);
mem_cgroup_free(mem);
__mem_cgroup_free(mem);
return ERR_PTR(-ENOMEM);
}

Expand All @@ -2190,7 +2181,7 @@ static void mem_cgroup_pre_destroy(struct cgroup_subsys *ss,
static void mem_cgroup_destroy(struct cgroup_subsys *ss,
struct cgroup *cont)
{
mem_cgroup_free(mem_cgroup_from_cont(cont));
mem_cgroup_put(mem_cgroup_from_cont(cont));
}

static int mem_cgroup_populate(struct cgroup_subsys *ss,
Expand Down

0 comments on commit 861a189

Please sign in to comment.