)]}'
{
  "commit": "5ceb9ce6fe9462a298bb2cd5c9f1ca6cb80a0199",
  "tree": "52a6d3c27eceb8848a8e8d7e3de9e39ff8cc680c",
  "parents": [
    "238305bb4d418c95977162ba13c11880685fc731"
  ],
  "author": {
    "name": "Bartlomiej Zolnierkiewicz",
    "email": "b.zolnierkie@samsung.com",
    "time": "Tue May 29 15:06:37 2012 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Tue May 29 16:22:22 2012 -0700"
  },
  "message": "mm: compaction: handle incorrect MIGRATE_UNMOVABLE type pageblocks\n\nWhen MIGRATE_UNMOVABLE pages are freed from MIGRATE_UNMOVABLE type\npageblock (and some MIGRATE_MOVABLE pages are left in it) waiting until an\nallocation takes ownership of the block may take too long.  The type of\nthe pageblock remains unchanged so the pageblock cannot be used as a\nmigration target during compaction.\n\nFix it by:\n\n* Adding enum compact_mode (COMPACT_ASYNC_[MOVABLE,UNMOVABLE], and\n  COMPACT_SYNC) and then converting sync field in struct compact_control\n  to use it.\n\n* Adding nr_pageblocks_skipped field to struct compact_control and\n  tracking how many destination pageblocks were of MIGRATE_UNMOVABLE type.\n   If COMPACT_ASYNC_MOVABLE mode compaction ran fully in\n  try_to_compact_pages() (COMPACT_COMPLETE) it implies that there is not a\n  suitable page for allocation.  In this case then check how if there were\n  enough MIGRATE_UNMOVABLE pageblocks to try a second pass in\n  COMPACT_ASYNC_UNMOVABLE mode.\n\n* Scanning the MIGRATE_UNMOVABLE pageblocks (during COMPACT_SYNC and\n  COMPACT_ASYNC_UNMOVABLE compaction modes) and building a count based on\n  finding PageBuddy pages, page_count(page) \u003d\u003d 0 or PageLRU pages.  If all\n  pages within the MIGRATE_UNMOVABLE pageblock are in one of those three\n  sets change the whole pageblock type to MIGRATE_MOVABLE.\n\nMy particular test case (on a ARM EXYNOS4 device with 512 MiB, which means\n131072 standard 4KiB pages in \u0027Normal\u0027 zone) is to:\n\n- allocate 120000 pages for kernel\u0027s usage\n- free every second page (60000 pages) of memory just allocated\n- allocate and use 60000 pages from user space\n- free remaining 60000 pages of kernel memory\n  (now we have fragmented memory occupied mostly by user space pages)\n- try to allocate 100 order-9 (2048 KiB) pages for kernel\u0027s usage\n\nThe results:\n- with compaction disabled I get 11 successful allocations\n- with compaction enabled - 14 successful allocations\n- with this patch I\u0027m able to get all 100 successful allocations\n\nNOTE: If we can make kswapd aware of order-0 request during compaction, we\ncan enhance kswapd with changing mode to COMPACT_ASYNC_FULL\n(COMPACT_ASYNC_MOVABLE + COMPACT_ASYNC_UNMOVABLE).  Please see the\nfollowing thread:\n\n\thttp://marc.info/?l\u003dlinux-mm\u0026m\u003d133552069417068\u0026w\u003d2\n\n[minchan@kernel.org: minor cleanups]\nCc: Mel Gorman \u003cmgorman@suse.de\u003e\nCc: Minchan Kim \u003cminchan@kernel.org\u003e\nCc: Rik van Riel \u003criel@redhat.com\u003e\nCc: Marek Szyprowski \u003cm.szyprowski@samsung.com\u003e\nSigned-off-by: Bartlomiej Zolnierkiewicz \u003cb.zolnierkie@samsung.com\u003e\nSigned-off-by: Kyungmin Park \u003ckyungmin.park@samsung.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": "51a90b7f2d606a3dcb9bb582cd209add0c429351",
      "old_mode": 33188,
      "old_path": "include/linux/compaction.h",
      "new_id": "e988037abd2a1afa25b9e22607295c0e915f1541",
      "new_mode": 33188,
      "new_path": "include/linux/compaction.h"
    },
    {
      "type": "modify",
      "old_id": "da7d35ea51034796e27fc7274a382c338c5a03e8",
      "old_mode": 33188,
      "old_path": "mm/compaction.c",
      "new_id": "840ee288e29656fdafc6c8a5bcb7441d5ff286c3",
      "new_mode": 33188,
      "new_path": "mm/compaction.c"
    },
    {
      "type": "modify",
      "old_id": "8b0fc8da802893d1f7be5892345950032b42d51f",
      "old_mode": 33188,
      "old_path": "mm/internal.h",
      "new_id": "4194ab9dc19b412aa8e15f1b89612aa2595f0c9f",
      "new_mode": 33188,
      "new_path": "mm/internal.h"
    },
    {
      "type": "modify",
      "old_id": "84f2c599d5d440fddf76de844cbffc5a17648e95",
      "old_mode": 33188,
      "old_path": "mm/page_alloc.c",
      "new_id": "457b4de122f4fdeba3309c2fedaf69fa055032d9",
      "new_mode": 33188,
      "new_path": "mm/page_alloc.c"
    }
  ]
}
