changelog ======================================== v3 -> v4: o fixed recursive shrink_zone problem. o add last_checked variable in shrink_zone for prevent corner case regression. v2 -> v3: o use wake_up() instead wake_up_all() o max reclaimers can be changed Kconfig option and sysctl. o some cleanups v1 -> v2: o make per zone throttle background ===================================== current VM implementation doesn't has limit of # of parallel reclaim. when heavy workload, it bring to 2 bad things - heavy lock contention - unnecessary swap out The end of last year, KAMEZA Hiroyuki proposed the patch of page reclaim throttle and explain it improve reclaim time. http://marc.info/?l=linux-mm&m=119667465917215&w=2 but unfortunately it works only memcgroup reclaim. Today, I implement it again for support global reclaim and mesure it. benefit ===================================== <<1. fix the bug of incorrect OOM killer>> if do following commanc, sometimes OOM killer happened. (OOM happend about 10%) $ ./hackbench 125 process 1000 because following bad scenario happend. 1. memory shortage happend. 2. many task call shrink_zone at the same time. 3. all page are isolated from LRU at the same time. 4. the last task can't isolate any page from LRU. 5. it cause reclaim failure. 6. it cause OOM killer. my patch is directly solution for that problem. <<2. performance improvement>> I mesure various parameter of hackbench. result number mean seconds (i.e. smaller is better) num_group 2.6.25-rc5-mm1 previous current proposal proposal ------------------------------------------------------------ 80 26.22 25.34 25.61 85 27.31 27.03 27.28 90 29.23 28.64 28.81 95 30.73 32.70 30.17 100 32.02 32.77 32.38 105 33.97 39.70 31.99 110 35.37 50.03 33.04 115 36.96 48.64 36.02 120 74.05 45.68 37.33 125 41.07(*) 64.13 38.88 130 86.92 56.30 51.64 135 234.62 74.31 57.09 140 291.95 117.74 83.76 145 425.35 131.99 92.01 150 766.92 160.63 128.27 (*) sometimes OOM happend, please don't think this is nice result. my patch get performance improvement at any parameter. (attached graph image)