)]}'
{
  "commit": "08e552c69c6930d64722de3ec18c51844d06ee28",
  "tree": "a744d57ed4b23401115f1033dcaac9e85d550e09",
  "parents": [
    "8c7c6e34a1256a5082d38c8e9bd1474476912715"
  ],
  "author": {
    "name": "KAMEZAWA Hiroyuki",
    "email": "kamezawa.hiroyu@jp.fujitsu.com",
    "time": "Wed Jan 07 18:08:01 2009 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Thu Jan 08 08:31:05 2009 -0800"
  },
  "message": "memcg: synchronized LRU\n\nA big patch for changing memcg\u0027s LRU semantics.\n\nNow,\n  - page_cgroup is linked to mem_cgroup\u0027s its own LRU (per zone).\n\n  - LRU of page_cgroup is not synchronous with global LRU.\n\n  - page and page_cgroup is one-to-one and statically allocated.\n\n  - To find page_cgroup is on what LRU, you have to check pc-\u003emem_cgroup as\n    - lru \u003d page_cgroup_zoneinfo(pc, nid_of_pc, zid_of_pc);\n\n  - SwapCache is handled.\n\nAnd, when we handle LRU list of page_cgroup, we do following.\n\n\tpc \u003d lookup_page_cgroup(page);\n\tlock_page_cgroup(pc); .....................(1)\n\tmz \u003d page_cgroup_zoneinfo(pc);\n\tspin_lock(\u0026mz-\u003elru_lock);\n\t.....add to LRU\n\tspin_unlock(\u0026mz-\u003elru_lock);\n\tunlock_page_cgroup(pc);\n\nBut (1) is spin_lock and we have to be afraid of dead-lock with zone-\u003elru_lock.\nSo, trylock() is used at (1), now. Without (1), we can\u0027t trust \"mz\" is correct.\n\nThis is a trial to remove this dirty nesting of locks.\nThis patch changes mz-\u003elru_lock to be zone-\u003elru_lock.\nThen, above sequence will be written as\n\n        spin_lock(\u0026zone-\u003elru_lock); # in vmscan.c or swap.c via global LRU\n\tmem_cgroup_add/remove/etc_lru() {\n\t\tpc \u003d lookup_page_cgroup(page);\n\t\tmz \u003d page_cgroup_zoneinfo(pc);\n\t\tif (PageCgroupUsed(pc)) {\n\t\t\t....add to LRU\n\t\t}\n        spin_lock(\u0026zone-\u003elru_lock); # in vmscan.c or swap.c via global LRU\n\nThis is much simpler.\n(*) We\u0027re safe even if we don\u0027t take lock_page_cgroup(pc). Because..\n    1. When pc-\u003emem_cgroup can be modified.\n       - at charge.\n       - at account_move().\n    2. at charge\n       the PCG_USED bit is not set before pc-\u003emem_cgroup is fixed.\n    3. at account_move()\n       the page is isolated and not on LRU.\n\nPros.\n  - easy for maintenance.\n  - memcg can make use of laziness of pagevec.\n  - we don\u0027t have to duplicated LRU/Active/Unevictable bit in page_cgroup.\n  - LRU status of memcg will be synchronized with global LRU\u0027s one.\n  - # of locks are reduced.\n  - account_move() is simplified very much.\nCons.\n  - may increase cost of LRU rotation.\n    (no impact if memcg is not configured.)\n\nSigned-off-by: KAMEZAWA Hiroyuki \u003ckamezawa.hiroyu@jp.fujitsu.com\u003e\nCc: Li Zefan \u003clizf@cn.fujitsu.com\u003e\nCc: Balbir Singh \u003cbalbir@in.ibm.com\u003e\nCc: Pavel Emelyanov \u003cxemul@openvz.org\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": "1abab5cee4ba8d552df8300e3561ff7e8a1375c3",
      "old_mode": 33188,
      "old_path": "fs/splice.c",
      "new_id": "a54b3e3f10a716cb63ab56311745716a70086d0f",
      "new_mode": 33188,
      "new_path": "fs/splice.c"
    },
    {
      "type": "modify",
      "old_id": "ca51ac72d6c0f7d77e0b6d5ca64aeaa2b343ec5d",
      "old_mode": 33188,
      "old_path": "include/linux/memcontrol.h",
      "new_id": "32c07b1852d6f7db0df1cff358f3ad47a20ce667",
      "new_mode": 33188,
      "new_path": "include/linux/memcontrol.h"
    },
    {
      "type": "modify",
      "old_id": "c948350c378e93cb9144e9c17c52f3445e8f4a80",
      "old_mode": 33188,
      "old_path": "include/linux/mm_inline.h",
      "new_id": "37ef13d0f01ecb7fab1901274348020b51c8e51c",
      "new_mode": 33188,
      "new_path": "include/linux/mm_inline.h"
    },
    {
      "type": "modify",
      "old_id": "d754b2dfbf2d6429635a2ebebd0579d5a43fa804",
      "old_mode": 33188,
      "old_path": "include/linux/page_cgroup.h",
      "new_id": "602cc1fdee90c152dc458642256b623ce8cbfa78",
      "new_mode": 33188,
      "new_path": "include/linux/page_cgroup.h"
    },
    {
      "type": "modify",
      "old_id": "2efcf38f3b73b18ef6040b607ad956c404c0d5b0",
      "old_mode": 33188,
      "old_path": "mm/memcontrol.c",
      "new_id": "8ce4e9e4795960e5258f3c77424fb209094b9d7a",
      "new_mode": 33188,
      "new_path": "mm/memcontrol.c"
    },
    {
      "type": "modify",
      "old_id": "685e7c8e1fd631123f2c7093b943dbb38c81c31a",
      "old_mode": 33188,
      "old_path": "mm/page_cgroup.c",
      "new_id": "74ae8e01d071492ddedd53909e397c1167a52c6b",
      "new_mode": 33188,
      "new_path": "mm/page_cgroup.c"
    },
    {
      "type": "modify",
      "old_id": "ba2c0e8b8b54387f1743ee60f3d97301820f1b28",
      "old_mode": 33188,
      "old_path": "mm/swap.c",
      "new_id": "8a98a9c9070470b78247920a02dd3666017b1c16",
      "new_mode": 33188,
      "new_path": "mm/swap.c"
    },
    {
      "type": "modify",
      "old_id": "f63b20dd7714989f2f2fe389cf81771358b15d1d",
      "old_mode": 33188,
      "old_path": "mm/vmscan.c",
      "new_id": "45983af1de3d5be02dc46119213426f72847a4da",
      "new_mode": 33188,
      "new_path": "mm/vmscan.c"
    }
  ]
}
