From: Balbir Singh 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: Balbir Singh Reviewed-by: KOSAKI Motohiro Cc: YAMAMOTO Takashi Cc: Paul Menage Cc: Pavel Emelianov Cc: KAMEZAWA Hiroyuki Signed-off-by: Andrew Morton --- mm/memcontrol.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff -puN mm/memcontrol.c~memcgroup-make-the-memory-controller-more-desktop-responsive mm/memcontrol.c --- a/mm/memcontrol.c~memcgroup-make-the-memory-controller-more-desktop-responsive +++ a/mm/memcontrol.c @@ -604,7 +604,6 @@ retry: mem_cgroup_out_of_memory(mem, gfp_mask); goto out; } - congestion_wait(WRITE, HZ/10); } pc->ref_cnt = 1; @@ -612,7 +611,7 @@ retry: pc->page = page; pc->flags = PAGE_CGROUP_FLAG_ACTIVE; if (ctype == MEM_CGROUP_CHARGE_TYPE_CACHE) - pc->flags |= PAGE_CGROUP_FLAG_CACHE; + pc->flags = PAGE_CGROUP_FLAG_CACHE; lock_page_cgroup(page); if (page_get_page_cgroup(page)) { _