From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mt1.gw.fujitsu.co.jp ([10.0.50.74]) by fgwmail2.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id mAUB1w6r000363 for (envelope-from kosaki.motohiro@jp.fujitsu.com); Sun, 30 Nov 2008 20:01:58 +0900 Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 5621845DE53 for ; Sun, 30 Nov 2008 20:01:58 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 250B945DE50 for ; Sun, 30 Nov 2008 20:01:58 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 08F921DB8037 for ; Sun, 30 Nov 2008 20:01:58 +0900 (JST) Received: from ml13.s.css.fujitsu.com (ml13.s.css.fujitsu.com [10.249.87.103]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 750231DB803B for ; Sun, 30 Nov 2008 20:01:57 +0900 (JST) From: KOSAKI Motohiro Subject: [PATCH 07/09] memcg: remove mem_cgroup_calc_reclaim() In-Reply-To: <20081130193502.8145.KOSAKI.MOTOHIRO@jp.fujitsu.com> References: <20081130193502.8145.KOSAKI.MOTOHIRO@jp.fujitsu.com> Message-Id: <20081130200058.815A.KOSAKI.MOTOHIRO@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Sun, 30 Nov 2008 20:01:56 +0900 (JST) Sender: owner-linux-mm@kvack.org Return-Path: To: LKML , linux-mm , Andrew Morton , Balbir Singh , KAMEZAWA Hiroyuki , Rik van Riel Cc: kosaki.motohiro@jp.fujitsu.com List-ID: Now, we can remove mem_cgroup_calc_reclaim() and mem cgroup reclaim also can use the same routine of global reclaim. it improve anon/file reclaim balancing on mem cgroup reclaim. Signed-off-by: KOSAKI Motohiro --- include/linux/memcontrol.h | 10 ---------- mm/memcontrol.c | 21 --------------------- mm/vmscan.c | 27 ++++++++++----------------- 3 files changed, 10 insertions(+), 48 deletions(-) Index: b/include/linux/memcontrol.h =================================================================== --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -87,9 +87,6 @@ extern void mem_cgroup_note_reclaim_prio int priority); extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, int priority); - -extern long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, struct zone *zone, - int priority, enum lru_list lru); int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone); struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, @@ -234,13 +231,6 @@ static inline void mem_cgroup_record_rec { } -static inline long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, - struct zone *zone, int priority, - enum lru_list lru) -{ - return 0; -} - static inline bool mem_cgroup_disabled(void) { return true; Index: b/mm/memcontrol.c =================================================================== --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -412,27 +412,6 @@ void mem_cgroup_record_reclaim_priority( mem->prev_priority = priority; } -/* - * Calculate # of pages to be scanned in this priority/zone. - * See also vmscan.c - * - * priority starts from "DEF_PRIORITY" and decremented in each loop. - * (see include/linux/mmzone.h) - */ - -long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, struct zone *zone, - int priority, enum lru_list lru) -{ - long nr_pages; - int nid = zone->zone_pgdat->node_id; - int zid = zone_idx(zone); - struct mem_cgroup_per_zone *mz = mem_cgroup_zoneinfo(mem, nid, zid); - - nr_pages = MEM_CGROUP_ZSTAT(mz, lru); - - return (nr_pages >> priority); -} - int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone) { unsigned long active; Index: b/mm/vmscan.c =================================================================== --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1524,31 +1524,24 @@ static void shrink_zone(int priority, st get_scan_ratio(zone, sc, percent); for_each_evictable_lru(l) { - if (scan_global_lru(sc)) { - int file = is_file_lru(l); - int scan; + int file = is_file_lru(l); + int scan; - scan = zone_page_state(zone, NR_LRU_BASE + l); - if (priority) { - scan >>= priority; - scan = (scan * percent[file]) / 100; - } + scan = zone_page_state(zone, NR_LRU_BASE + l); + if (priority) { + scan >>= priority; + scan = (scan * percent[file]) / 100; + } + if (scan_global_lru(sc)) { zone->lru[l].nr_scan += scan; nr[l] = zone->lru[l].nr_scan; if (nr[l] >= sc->swap_cluster_max) zone->lru[l].nr_scan = 0; else nr[l] = 0; - } else { - /* - * This reclaim occurs not because zone memory shortage - * but because memory controller hits its limit. - * Don't modify zone reclaim related data. - */ - nr[l] = mem_cgroup_calc_reclaim(sc->mem_cgroup, zone, - priority, l); - } + } else + nr[l] = scan; } while (nr[LRU_INACTIVE_ANON] || nr[LRU_ACTIVE_FILE] || -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org