linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memcg: remove mem_cgroup_calc_mapped_ratio()
@ 2009-02-10  9:45 KOSAKI Motohiro
  2009-02-10 10:59 ` Balbir Singh
  0 siblings, 1 reply; 3+ messages in thread
From: KOSAKI Motohiro @ 2009-02-10  9:45 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki, Balbir Singh, LKML, linux-mm, Andrew Morton
  Cc: kosaki.motohiro


Currently, mem_cgroup_calc_mapped_ratio() is unused at all.
it can be removed and KAMEZAWA-san suggested it.


Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
---
 mm/memcontrol.c |   17 -----------------
 1 file changed, 17 deletions(-)

Index: b/mm/memcontrol.c
===================================================================
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -445,23 +445,6 @@ int task_in_mem_cgroup(struct task_struc
 	return ret;
 }
 
-/*
- * Calculate mapped_ratio under memory controller. This will be used in
- * vmscan.c for deteremining we have to reclaim mapped pages.
- */
-int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem)
-{
-	long total, rss;
-
-	/*
-	 * usage is recorded in bytes. But, here, we assume the number of
-	 * physical pages can be represented by "long" on any arch.
-	 */
-	total = (long) (mem->res.usage >> PAGE_SHIFT) + 1L;
-	rss = (long)mem_cgroup_read_stat(&mem->stat, MEM_CGROUP_STAT_RSS);
-	return (int)((rss * 100L) / total);
-}
-
 static int calc_inactive_ratio(struct mem_cgroup *memcg, unsigned long *present_pages)
 {
 	unsigned long active;


--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] memcg: remove mem_cgroup_calc_mapped_ratio()
  2009-02-10  9:45 [PATCH] memcg: remove mem_cgroup_calc_mapped_ratio() KOSAKI Motohiro
@ 2009-02-10 10:59 ` Balbir Singh
  2009-02-10 11:47   ` [PATCH] memcg: remove mem_cgroup_calc_mapped_ratio() take2 KOSAKI Motohiro
  0 siblings, 1 reply; 3+ messages in thread
From: Balbir Singh @ 2009-02-10 10:59 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: KAMEZAWA Hiroyuki, LKML, linux-mm, Andrew Morton

* KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> [2009-02-10 18:45:33]:

> 
> Currently, mem_cgroup_calc_mapped_ratio() is unused at all.
> it can be removed and KAMEZAWA-san suggested it.
> 
> 
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
>

Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
 

-- 
	Balbir

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] memcg: remove mem_cgroup_calc_mapped_ratio() take2
  2009-02-10 10:59 ` Balbir Singh
@ 2009-02-10 11:47   ` KOSAKI Motohiro
  0 siblings, 0 replies; 3+ messages in thread
From: KOSAKI Motohiro @ 2009-02-10 11:47 UTC (permalink / raw)
  To: balbir
  Cc: kosaki.motohiro, KAMEZAWA Hiroyuki, LKML, linux-mm, Andrew Morton,
	Johannes Weiner


Changelog:
  v1 -> v2
    - The calc_mapped_ratio prototype also be removed.

========

Currently, mem_cgroup_calc_mapped_ratio() is unused at all.
it can be removed and KAMEZAWA-san suggested it.


Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
---
 include/linux/memcontrol.h |    6 ------
 mm/memcontrol.c            |   17 -----------------
 2 files changed, 23 deletions(-)

Index: b/mm/memcontrol.c
===================================================================
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -445,23 +445,6 @@ int task_in_mem_cgroup(struct task_struc
 	return ret;
 }
 
-/*
- * Calculate mapped_ratio under memory controller. This will be used in
- * vmscan.c for deteremining we have to reclaim mapped pages.
- */
-int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem)
-{
-	long total, rss;
-
-	/*
-	 * usage is recorded in bytes. But, here, we assume the number of
-	 * physical pages can be represented by "long" on any arch.
-	 */
-	total = (long) (mem->res.usage >> PAGE_SHIFT) + 1L;
-	rss = (long)mem_cgroup_read_stat(&mem->stat, MEM_CGROUP_STAT_RSS);
-	return (int)((rss * 100L) / total);
-}
-
 static int calc_inactive_ratio(struct mem_cgroup *memcg, unsigned long *present_pages)
 {
 	unsigned long active;
Index: b/include/linux/memcontrol.h
===================================================================
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -88,7 +88,6 @@ extern void mem_cgroup_end_migration(str
 /*
  * For memory reclaim.
  */
-extern int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem);
 extern long mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem);
 int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg);
 unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg,
@@ -203,11 +202,6 @@ static inline void mem_cgroup_end_migrat
 {
 }
 
-static inline int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem)
-{
-	return 0;
-}
-
 static inline int mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem)
 {
 	return 0;



--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-10 11:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-10  9:45 [PATCH] memcg: remove mem_cgroup_calc_mapped_ratio() KOSAKI Motohiro
2009-02-10 10:59 ` Balbir Singh
2009-02-10 11:47   ` [PATCH] memcg: remove mem_cgroup_calc_mapped_ratio() take2 KOSAKI Motohiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).