Commit 4a56d02e authored by Balbir Singh's avatar Balbir Singh Committed by Linus Torvalds

memcgroup: make the memory controller more desktop responsive

This patch makes the memory controller more responsive on my desktop.

1. Set all cached pages as inactive.  We were by default marking all pages
   as active, thus forcing us to go through two passes for reclaiming pages

2. Remove congestion_wait(), since we already have that logic in
   do_try_to_free_pages()
Signed-off-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
Reviewed-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Cc: Pavel Emelianov <xemul@openvz.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3eae90c3
...@@ -591,7 +591,6 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, ...@@ -591,7 +591,6 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
mem_cgroup_out_of_memory(mem, gfp_mask); mem_cgroup_out_of_memory(mem, gfp_mask);
goto out; goto out;
} }
congestion_wait(WRITE, HZ/10);
} }
pc->ref_cnt = 1; pc->ref_cnt = 1;
...@@ -599,7 +598,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, ...@@ -599,7 +598,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
pc->page = page; pc->page = page;
pc->flags = PAGE_CGROUP_FLAG_ACTIVE; pc->flags = PAGE_CGROUP_FLAG_ACTIVE;
if (ctype == MEM_CGROUP_CHARGE_TYPE_CACHE) if (ctype == MEM_CGROUP_CHARGE_TYPE_CACHE)
pc->flags |= PAGE_CGROUP_FLAG_CACHE; pc->flags = PAGE_CGROUP_FLAG_CACHE;
lock_page_cgroup(page); lock_page_cgroup(page);
if (page_get_page_cgroup(page)) { if (page_get_page_cgroup(page)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment