Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83787
b: refs/heads/master
c: 3564c7c
h: refs/heads/master
i:
  83785: 06b2279
  83783: e951088
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Feb 7, 2008
1 parent ba89be7 commit 25a8ed6
Show file tree
Hide file tree
Showing 2 changed files with 8 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: 82369553d6d3bc67c54129a02e0bc0b5b88f3045
refs/heads/master: 3564c7c45156b358efe921ab2e4e516dad92c94c
10 changes: 7 additions & 3 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ struct page_cgroup {
int flags;
};
#define PAGE_CGROUP_FLAG_CACHE (0x1) /* charged as cache */
#define PAGE_CGROUP_FLAG_ACTIVE (0x2) /* page is active in this cgroup */

enum {
MEM_CGROUP_TYPE_UNSPEC = 0,
Expand Down Expand Up @@ -213,10 +214,13 @@ clear_page_cgroup(struct page *page, struct page_cgroup *pc)

static void __mem_cgroup_move_lists(struct page_cgroup *pc, bool active)
{
if (active)
if (active) {
pc->flags |= PAGE_CGROUP_FLAG_ACTIVE;
list_move(&pc->lru, &pc->mem_cgroup->active_list);
else
} else {
pc->flags &= ~PAGE_CGROUP_FLAG_ACTIVE;
list_move(&pc->lru, &pc->mem_cgroup->inactive_list);
}
}

int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem)
Expand Down Expand Up @@ -403,7 +407,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
atomic_set(&pc->ref_cnt, 1);
pc->mem_cgroup = mem;
pc->page = page;
pc->flags = 0;
pc->flags = PAGE_CGROUP_FLAG_ACTIVE;
if (ctype == MEM_CGROUP_CHARGE_TYPE_CACHE)
pc->flags |= PAGE_CGROUP_FLAG_CACHE;

Expand Down

0 comments on commit 25a8ed6

Please sign in to comment.