linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 0/7] memcg async reclaim
@ 2011-05-10 10:02 KAMEZAWA Hiroyuki
  2011-05-10 10:04 ` [RFC][PATCH 1/7] memcg: check margin to limit for " KAMEZAWA Hiroyuki
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-05-10 10:02 UTC (permalink / raw)
  To: linux-mm@kvack.org
  Cc: linux-kernel@vger.kernel.org, Ying Han, Johannes Weiner,
	Michal Hocko, balbir@linux.vnet.ibm.com,
	nishimura@mxp.nes.nec.co.jp

Hi, thank you for all comments on previous patches for watermarks for memcg.

This is a new series as 'async reclaim', no watermark.
This version is a RFC again and I don't ask anyone to test this...but
comments/review are appreciated. 

Major changes are
  - no configurable watermark
  - hierarchy support
  - more fix for static scan rate round robin scanning of memcg.

(assume x86-64 in following.)

'async reclaim' works when
   - usage > limit - 4MB.
until
   - usage < limit - 8MB.

when the limit is larger than 128MB. This value of margin to limit
has some purpose for helping to reduce page fault latency at using
Transparent hugepage.

Considering THP, we need to reclaim HPAGE_SIZE(2MB) of pages when we hit
limit and consume HPAGE_SIZE(2MB) immediately. Then, the application need to
scan 2MB per each page fault and get big latency. So, some margin > HPAGE_SIZE
is required. I set it as 2*HPAGE_SIZE/4*HPAGE_SIZE, here. The kernel
will do async reclaim and reduce usage to limit - 8MB in background.

BTW, when an application gets a page, it tend to do some action to fill the
gotton page. For example, reading data from file/network and fill buffer.
This implies the application will have a wait or consumes cpu other than
reclaiming memory. So, if the kernel can help memory freeing in background
while application does another jobs, application latency can be reduced.
Then, this kind of asyncronous reclaim of memory will be a help for reduce
memory reclaim latency by memcg. But the total amount of cpu time consumed
will not have any difference.

This patch series implements
  - a logic for trigger async reclaim
  - help functions for async reclaim
  - core logic for async reclaim, considering memcg's hierarchy.
  - static scan rate memcg reclaim.
  - workqueue for async reclaim.

Some concern is that I didn't implement a code for handle the case
most of pages are mlocked or anon memory in swapless system. I need some
detection logic to avoid hopless async reclaim.

Any comments are welcome.

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>

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

end of thread, other threads:[~2011-05-14  0:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-10 10:02 [RFC][PATCH 0/7] memcg async reclaim KAMEZAWA Hiroyuki
2011-05-10 10:04 ` [RFC][PATCH 1/7] memcg: check margin to limit for " KAMEZAWA Hiroyuki
2011-05-10 10:05 ` [RFC][PATCH 2/7] memcg: count reclaimable pages per zone KAMEZAWA Hiroyuki
2011-05-10 10:07 ` [RFC][PATCH 3/7] memcg: export memcg swappiness KAMEZAWA Hiroyuki
2011-05-10 10:08 ` [RFC][PATCH 4/7] memcg : test a memcg is reclaimable KAMEZAWA Hiroyuki
2011-05-10 10:09 ` [RFC][PATCH 5/7] memcg : export select victim memcg KAMEZAWA Hiroyuki
2011-05-10 10:13 ` [RFC][PATCH 6/7] memcg : static scan for async reclaim KAMEZAWA Hiroyuki
2011-05-10 10:13 ` [RFC][PATCH 7/7] memcg: workqueue " KAMEZAWA Hiroyuki
2011-05-12  1:28 ` [RFC][PATCH 0/7] memcg " Andrew Morton
2011-05-12  1:35   ` KAMEZAWA Hiroyuki
2011-05-12  2:11     ` Ying Han
2011-05-12  3:51     ` Andrew Morton
2011-05-12  4:22       ` KAMEZAWA Hiroyuki
2011-05-12  8:17         ` KAMEZAWA Hiroyuki
2011-05-13  3:03           ` KAMEZAWA Hiroyuki
2011-05-13  5:10             ` Ying Han
2011-05-13  9:04               ` KAMEZAWA Hiroyuki
2011-05-14  0:25               ` Ying Han
2011-05-14  0:29                 ` Ying Han

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).