| From: |
| KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> |
| To: |
| Ying Han <yinghan@google.com> |
| Subject: |
| [PATCH 0/7] memcg background reclaim , yet another one. |
| Date: |
| Mon, 25 Apr 2011 18:25:29 +0900 |
| Message-ID: |
| <20110425182529.c7c37bb4.kamezawa.hiroyu@jp.fujitsu.com> |
| Cc: |
| "linux-mm@kvack.org" <linux-mm@kvack.org>,
"kosaki.motohiro@jp.fujitsu.com" <kosaki.motohiro@jp.fujitsu.com>,
"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>, Johannes Weiner
<jweiner@redhat.com>, "minchan.kim@gmail.com" <minchan.kim@gmail.com>,
Michal Hocko <mhocko@suse.cz> |
| Archive-link: |
| Article, Thread
|
This patch is based on Ying Han's one....at its origin, but I changed too much ;)
Then, start this as new thread.
(*) This work is not related to the topic "rewriting global LRU using memcg"
discussion, at all. This kind of hi/low watermark has been planned since
memcg was born.
At first, per-memcg background reclaim is used for
- helping memory reclaim and avoid direct reclaim.
- set a not-hard limit of memory usage.
For example, assume a memcg has its hard-limit as 500M bytes.
Then, set high-watermark as 400M. Here, memory usage can exceed 400M up to 500M
but memory usage will be reduced automatically to 400M as time goes by.
This is useful when a user want to limit memory usage to 400M but don't want to
see big performance regression by hitting limit when memory usage spike happens.
1) == hard limit = 400M ==
[root@rhel6-test hilow]# time cp ./tmpfile xxx
real 0m7.353s
user 0m0.009s
sys 0m3.280s
2) == hard limit 500M/ hi_watermark = 400M ==
[root@rhel6-test hilow]# time cp ./tmpfile xxx
real 0m6.421s
user 0m0.059s
sys 0m2.707s
Above is a brief result on VM and needs more study. But my impression is positive.
I'd like to use bigger real machine in the next time.
Here is a short list of updates from Ying Han's one.
1. use workqueue and visit memcg in round robin.
2. only allow setting hi watermark. low-watermark is automatically determined.
This is good for avoiding bad cpu usage by background reclaim.
3. totally rewrite algorithm of shrink_mem_cgroup for round-robin.
4. fixed get_scan_count() , this was problematic.
5. added some statistics, which I think necessary.
6. added documenation
Then, the algorithm is not a cut-n-paste from kswapd. I thought kswapd should be
updated...and 'priority' in vmscan.c seems to be an enemy of memcg ;)
Thanks
-Kame
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>