Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105903
b: refs/heads/master
c: 508b7be
h: refs/heads/master
i:
  105901: 20c70a7
  105899: ed387ac
  105895: 5ccf3cb
  105887: 784d34f
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Jul 25, 2008
1 parent 0b7194c commit e42919d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: a181b0e888a1d917edcab57cd73ccf7d8e75a46c
refs/heads/master: 508b7be0a5b06b64203512ed9b34191cddc83f56
11 changes: 8 additions & 3 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ static void __mem_cgroup_remove_list(struct mem_cgroup_per_zone *mz,
MEM_CGROUP_ZSTAT(mz, MEM_CGROUP_ZSTAT_INACTIVE) -= 1;

mem_cgroup_charge_statistics(pc->mem_cgroup, pc->flags, false);
list_del_init(&pc->lru);
list_del(&pc->lru);
}

static void __mem_cgroup_add_list(struct mem_cgroup_per_zone *mz,
Expand Down Expand Up @@ -559,7 +559,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
}
unlock_page_cgroup(page);

pc = kmem_cache_zalloc(page_cgroup_cache, gfp_mask);
pc = kmem_cache_alloc(page_cgroup_cache, gfp_mask);
if (pc == NULL)
goto err;

Expand Down Expand Up @@ -606,9 +606,14 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
pc->ref_cnt = 1;
pc->mem_cgroup = mem;
pc->page = page;
pc->flags = PAGE_CGROUP_FLAG_ACTIVE;
/*
* If a page is accounted as a page cache, insert to inactive list.
* If anon, insert to active list.
*/
if (ctype == MEM_CGROUP_CHARGE_TYPE_CACHE)
pc->flags = PAGE_CGROUP_FLAG_CACHE;
else
pc->flags = PAGE_CGROUP_FLAG_ACTIVE;

lock_page_cgroup(page);
if (page_get_page_cgroup(page)) {
Expand Down

0 comments on commit e42919d

Please sign in to comment.