)]}'
{
  "commit": "eb709b0d062efd653a61183af8e27b2711c3cf5c",
  "tree": "ea0b4139854c2e713acab7ac679fa368ef9187ef",
  "parents": [
    "f68aa5b445fd00b67588ade611a4efb1a34dadb4"
  ],
  "author": {
    "name": "Shaohua Li",
    "email": "shaohua.li@intel.com",
    "time": "Tue May 24 17:12:55 2011 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Wed May 25 08:39:37 2011 -0700"
  },
  "message": "mm: batch activate_page() to reduce lock contention\n\nThe zone-\u003elru_lock is heavily contented in workload where activate_page()\nis frequently used.  We could do batch activate_page() to reduce the lock\ncontention.  The batched pages will be added into zone list when the pool\nis full or page reclaim is trying to drain them.\n\nFor example, in a 4 socket 64 CPU system, create a sparse file and 64\nprocesses, processes shared map to the file.  Each process read access the\nwhole file and then exit.  The process exit will do unmap_vmas() and cause\na lot of activate_page() call.  In such workload, we saw about 58% total\ntime reduction with below patch.  Other workloads with a lot of\nactivate_page also benefits a lot too.\n\nAndrew Morton suggested activate_page() and putback_lru_pages() should\nfollow the same path to active pages, but this is hard to implement (see\ncommit 7a608572a282a (\"Revert \"mm: batch activate_page() to reduce lock\ncontention\")).  On the other hand, do we really need putback_lru_pages()\nto follow the same path?  I tested several FIO/FFSB benchmark (about 20\nscripts for each benchmark) in 3 machines here from 2 sockets to 4\nsockets.  My test doesn\u0027t show anything significant with/without below\npatch (there is slight difference but mostly some noise which we found\neven without below patch before).  Below patch basically returns to the\nsame as my first post.\n\nI tested some microbenchmarks:\n  case-anon-cow-rand-mt         0.58%\n  case-anon-cow-rand           -3.30%\n  case-anon-cow-seq-mt         -0.51%\n  case-anon-cow-seq            -5.68%\n  case-anon-r-rand-mt           0.23%\n  case-anon-r-rand              0.81%\n  case-anon-r-seq-mt           -0.71%\n  case-anon-r-seq              -1.99%\n  case-anon-rx-rand-mt          2.11%\n  case-anon-rx-seq-mt           3.46%\n  case-anon-w-rand-mt          -0.03%\n  case-anon-w-rand             -0.50%\n  case-anon-w-seq-mt           -1.08%\n  case-anon-w-seq              -0.12%\n  case-anon-wx-rand-mt         -5.02%\n  case-anon-wx-seq-mt          -1.43%\n  case-fork                     1.65%\n  case-fork-sleep              -0.07%\n  case-fork-withmem             1.39%\n  case-hugetlb                 -0.59%\n  case-lru-file-mmap-read-mt   -0.54%\n  case-lru-file-mmap-read       0.61%\n  case-lru-file-mmap-read-rand -2.24%\n  case-lru-file-readonce       -0.64%\n  case-lru-file-readtwice     -11.69%\n  case-lru-memcg               -1.35%\n  case-mmap-pread-rand-mt       1.88%\n  case-mmap-pread-rand        -15.26%\n  case-mmap-pread-seq-mt        0.89%\n  case-mmap-pread-seq         -69.72%\n  case-mmap-xread-rand-mt       0.71%\n  case-mmap-xread-seq-mt        0.38%\n\nThe most significent are:\n  case-lru-file-readtwice     -11.69%\n  case-mmap-pread-rand        -15.26%\n  case-mmap-pread-seq         -69.72%\n\nwhich use activate_page a lot.  others are basically variations because\neach run has slightly difference.\n\nIn UP case, \u0027size mm/swap.o\u0027\nbefore the two patches:\n   text    data     bss     dec     hex filename\n   6466     896       4    7366    1cc6 mm/swap.o\nafter the two patches:\n   text    data     bss     dec     hex filename\n   6343     896       4    7243    1c4b mm/swap.o\n\nSigned-off-by: Shaohua Li \u003cshaohua.li@intel.com\u003e\nCc: KOSAKI Motohiro \u003ckosaki.motohiro@jp.fujitsu.com\u003e\nCc: Hiroyuki Kamezawa \u003ckamezawa.hiroyuki@gmail.com\u003e\nCc: Andi Kleen \u003candi@firstfloor.org\u003e\nCc: Minchan Kim \u003cminchan.kim@gmail.com\u003e\nCc: Rik van Riel \u003criel@redhat.com\u003e\nCc: Mel Gorman \u003cmel@csn.ul.ie\u003e\nCc: Johannes Weiner \u003channes@cmpxchg.org\u003e\nCc: Hugh Dickins \u003chughd@google.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2f365d1a4bb2c33be69036121c325f2c4f103604",
      "old_mode": 33188,
      "old_path": "mm/swap.c",
      "new_id": "3a442f18b0b3dab5acfd99b5fc4e85389b9b5439",
      "new_mode": 33188,
      "new_path": "mm/swap.c"
    }
  ]
}
