Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83778
b: refs/heads/master
c: ff7283f
h: refs/heads/master
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Feb 7, 2008
1 parent 5bd2101 commit 3892ba1
Show file tree
Hide file tree
Showing 2 changed files with 11 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: ae41be374293e70e1ed441d986afcc6e744ef9d9
refs/heads/master: ff7283fa3a66823933991ad55a558a3a01d5ab27
13 changes: 10 additions & 3 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,19 +250,26 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
unsigned long scan;
LIST_HEAD(pc_list);
struct list_head *src;
struct page_cgroup *pc;
struct page_cgroup *pc, *tmp;

if (active)
src = &mem_cont->active_list;
else
src = &mem_cont->inactive_list;

spin_lock(&mem_cont->lru_lock);
for (scan = 0; scan < nr_to_scan && !list_empty(src); scan++) {
pc = list_entry(src->prev, struct page_cgroup, lru);
scan = 0;
list_for_each_entry_safe_reverse(pc, tmp, src, lru) {
if (scan++ > nr_to_scan)
break;
page = pc->page;
VM_BUG_ON(!pc);

if (unlikely(!PageLRU(page))) {
scan--;
continue;
}

if (PageActive(page) && !active) {
__mem_cgroup_move_lists(pc, true);
scan--;
Expand Down

0 comments on commit 3892ba1

Please sign in to comment.