linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/13] memory cgroup updates v4
@ 2008-09-22 10:51 KAMEZAWA Hiroyuki
  2008-09-22 10:55 ` [PATCH 1/13] memcg: avoid accounting special mapping KAMEZAWA Hiroyuki
                   ` (13 more replies)
  0 siblings, 14 replies; 37+ messages in thread
From: KAMEZAWA Hiroyuki @ 2008-09-22 10:51 UTC (permalink / raw)
  To: linux-mm; +Cc: balbir, nishimura, xemul, LKML

This is a series of patches for memory resource controller.
Based on mmotm Sep18 ver. This passed some tests and seems works well.

This consists of followings

  - fixes.
    * fixes do_swap_page() handling.
  - new feature
    * "root" cgroup is treated as nolimit.
    * implements account_move() and move account at force_empty rather than
      forgeting all.
    * atomic page_cgroup->flags.
    * page_cgroup lookup system. (and page_cgroup.h is added.)
  - optimize.
    * per cpu status update.
  - remove page_cgroup pointer from struct page.
  - lazy lru add/remove
  
peformance is here. (on 8cpu Xeon/64bit) not so bad.

2.6.26-rc6-mm1(2008/9/18 version)
==
Execl Throughput                           2311.6 lps   (29.9 secs, 3 samples)
C Compiler Throughput                      1331.9 lpm   (60.4 secs, 3 samples)
Shell Scripts (1 concurrent)               7500.7 lpm   (60.0 secs, 3 samples)
Shell Scripts (8 concurrent)               3031.0 lpm   (60.0 secs, 3 samples)
Shell Scripts (16 concurrent)              1729.7 lpm   (60.0 secs, 3 samples)
Dc: sqrt(2) to 99 decimal places          99310.2 lpm   (30.0 secs, 3 samples)

afte all patches.
==
Execl Throughput                           2308.7 lps   (29.9 secs, 3 samples)
C Compiler Throughput                      1343.4 lpm   (60.3 secs, 3 samples)
Shell Scripts (1 concurrent)               7451.7 lpm   (60.0 secs, 3 samples)
Shell Scripts (8 concurrent)               3024.0 lpm   (60.0 secs, 3 samples)
Shell Scripts (16 concurrent)              1752.0 lpm   (60.0 secs, 3 samples)
Dc: sqrt(2) to 99 decimal places          99255.3 lpm   (30.0 secs, 3 samples)

after all patches + add padding to make "struct page" to be 64 bytes ;)
==
Execl Throughput                           2332.2 lps   (29.9 secs, 3 samples)
C Compiler Throughput                      1345.3 lpm   (60.4 secs, 3 samples)
Shell Scripts (1 concurrent)               7564.3 lpm   (60.0 secs, 3 samples)
Shell Scripts (8 concurrent)               3075.0 lpm   (60.0 secs, 3 samples)
Shell Scripts (16 concurrent)              1755.0 lpm   (60.0 secs, 3 samples)
Dc: sqrt(2) to 99 decimal places          99979.3 lpm   (30.0 secs, 3 samples)



This patch set saves 8bytes per page struct.
(when CONFIG_MEM_RES_CTLR=y but memcg is disabled at boot)
On this 48Gbytes machine, 48 * 1024 * 1024 * 1024 / 4096 * 8 = 96MB.
Maybe good for distros and users who don't want memcg.

Extra memory usage by this hash routine is 16k for root hash table on this
machine and 20bytes per 128MB. (and some per-cpu area.)

IMHO, because "lookup_page_cgroup" interface is added, updates/optimzation
for internal lookup method can be done later. (we can do some.)
So, I don't want to discuss special-lookup-support-for-some-memory-model
or which-is-quicker-lookup-method etc...too much here.

Brief description.

1/13 .... special mapping fix. (NEW)
     => avoid accounting pages not on LRU...which we cannot reclaim.

2/13 .... account swap-cache under lock.
     => move accounting of swap-cache under lock for avoiding unnecessary race.
         
3/13 .... make root cgroup to be unlimited.
     => fix root cgroup's memory limit to unlimited.

4/13 .... atomic-flags for page_cgroup
     => make page_cgroup->flags to be atomic.

5/13 .... implement move_account function.
     => add a function for moving page_cgroup's account to other cgroup.

6/13 ... force_empty to migrate account
     => move all account to root cgroup rather than forget all.

7/13 ...make mapping NULL (clean up)
     => ensure page->mapping to be NULL before calling mem_cgroup_uncharge_cache().

8/13 ...optimize cpustat
     => optimize access to per-cpu statistics for memcg.

9/13 ...lookup page_cgroup (CHANGED)
     => preallocate all page_cgroup at boot and remove page->page_cgroup pointer.

10/13...page_cgroup lookaside buffer 
     => helps looking up page_cgroup from page.

11/13...lazy lru freeing page_cgroup (NEW)
     => do removal from LRU in bached manner like pagevec.

12/13...lazy lru add page_cgroup (NEW)
     => do addition to LRU in bached manner like pagevec.

13/13...swap accountig fix. (NEW)
     => fix race in swap accounting (can be happen)
        and this intrduce new protocal as precharge/commit/cancel.

Some patches are big but not complicated I think.

patch 13/13 includes a brandnew concept.
So please review and tell me your opinion.


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

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

end of thread, other threads:[~2008-09-24  8:46 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-22 10:51 [PATCH 0/13] memory cgroup updates v4 KAMEZAWA Hiroyuki
2008-09-22 10:55 ` [PATCH 1/13] memcg: avoid accounting special mapping KAMEZAWA Hiroyuki
2008-09-22 10:57 ` [PATCH 2/13] memcg: account fault-in swap under lock KAMEZAWA Hiroyuki
2008-09-22 10:58 ` [PATCH 3/13] memcg: nolimit root cgroup KAMEZAWA Hiroyuki
2008-09-22 11:00 ` [PATCH 4/13] memcg: force_empty moving account KAMEZAWA Hiroyuki
2008-09-22 14:23   ` Peter Zijlstra
2008-09-22 14:50   ` kamezawa.hiroyu
2008-09-22 14:56     ` Peter Zijlstra
2008-09-22 15:06     ` kamezawa.hiroyu
2008-09-22 15:32       ` Peter Zijlstra
2008-09-22 15:43       ` kamezawa.hiroyu
2008-09-22 11:02 ` [PATCH 5/13] memcg: cleanup to make mapping null before unchage KAMEZAWA Hiroyuki
2008-09-22 11:03 ` [PATCH 6/13] memcg: optimze per cpu accounting for memcg KAMEZAWA Hiroyuki
2008-09-22 11:05 ` [PATCH 3.5/13] memcg: make page_cgroup flags to be atomic KAMEZAWA Hiroyuki
2008-09-22 11:09 ` [PATCH 3.6/13] memcg: add function to move account KAMEZAWA Hiroyuki
2008-09-24  6:50   ` Daisuke Nishimura
2008-09-24  7:11     ` KAMEZAWA Hiroyuki
2008-09-22 11:12 ` [PATCH 9/13] memcg: lookup page cgroup (and remove pointer from struct page) KAMEZAWA Hiroyuki
2008-09-22 14:52   ` Dave Hansen
2008-09-22 15:14   ` kamezawa.hiroyu
2008-09-22 15:47     ` Dave Hansen
2008-09-22 15:57     ` kamezawa.hiroyu
2008-09-22 16:10       ` Dave Hansen
2008-09-22 17:34       ` kamezawa.hiroyu
2008-09-22 15:47   ` Peter Zijlstra
2008-09-22 16:04   ` kamezawa.hiroyu
2008-09-22 16:06     ` Peter Zijlstra
2008-09-23 23:48   ` KAMEZAWA Hiroyuki
2008-09-24  2:09     ` Balbir Singh
2008-09-24  3:09       ` KAMEZAWA Hiroyuki
2008-09-24  8:31         ` Balbir Singh
2008-09-24  8:46           ` KAMEZAWA Hiroyuki
2008-09-22 11:13 ` [PATCH 10/13] memcg: page_cgroup look aside table KAMEZAWA Hiroyuki
2008-09-22 11:17 ` [PATCH 11/13] memcg: lazy LRU free (NEW) KAMEZAWA Hiroyuki
2008-09-22 11:22 ` [PATCH 12/13] memcg: lazy LRU add KAMEZAWA Hiroyuki
2008-09-22 11:24 ` [PATCH 13/13] memcg: swap accounting fix KAMEZAWA Hiroyuki
2008-09-22 11:28 ` [PATCH 0/13] memory cgroup updates v4 KAMEZAWA Hiroyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox