)]}'
{
  "commit": "89f5b7da2a6bad2e84670422ab8192382a5aeb9f",
  "tree": "4f55cf9ef8a76d4b9a960e1b443ed015e63e713f",
  "parents": [
    "9bedbcb207ed9a571b239231d99c8fd4a34ae24d"
  ],
  "author": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Fri Jun 20 11:18:25 2008 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Fri Jun 20 11:18:25 2008 -0700"
  },
  "message": "Reinstate ZERO_PAGE optimization in \u0027get_user_pages()\u0027 and fix XIP\n\nKAMEZAWA Hiroyuki and Oleg Nesterov point out that since the commit\n557ed1fa2620dc119adb86b34c614e152a629a80 (\"remove ZERO_PAGE\") removed\nthe ZERO_PAGE from the VM mappings, any users of get_user_pages() will\ngenerally now populate the VM with real empty pages needlessly.\n\nWe used to get the ZERO_PAGE when we did the \"handle_mm_fault()\", but\nsince fault handling no longer uses ZERO_PAGE for new anonymous pages,\nwe now need to handle that special case in follow_page() instead.\n\nIn particular, the removal of ZERO_PAGE effectively removed the core\nfile writing optimization where we would skip writing pages that had not\nbeen populated at all, and increased memory pressure a lot by allocating\nall those useless newly zeroed pages.\n\nThis reinstates the optimization by making the unmapped PTE case the\nsame as for a non-existent page table, which already did this correctly.\n\nWhile at it, this also fixes the XIP case for follow_page(), where the\ncaller could not differentiate between the case of a page that simply\ncould not be used (because it had no \"struct page\" associated with it)\nand a page that just wasn\u0027t mapped.\n\nWe do that by simply returning an error pointer for pages that could not\nbe turned into a \"struct page *\".  The error is arbitrarily picked to be\nEFAULT, since that was what get_user_pages() already used for the\nequivalent IO-mapped page case.\n\n[ Also removed an impossible test for pte_offset_map_lock() failing:\n  that\u0027s not how that function works ]\n\nAcked-by: Oleg Nesterov \u003coleg@tv-sign.ru\u003e\nAcked-by: Nick Piggin \u003cnpiggin@suse.de\u003e\nCc: KAMEZAWA Hiroyuki \u003ckamezawa.hiroyu@jp.fujitsu.com\u003e\nCc: Hugh Dickins \u003chugh@veritas.com\u003e\nCc: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nCc: Roland McGrath \u003croland@redhat.com\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c21a626af676fde938922c25e110c203e892a24f",
      "old_mode": 33188,
      "old_path": "arch/powerpc/kernel/vdso.c",
      "new_id": "ce245a850db2b8d90d0d35dcd98a2e1fa39d97b7",
      "new_mode": 33188,
      "new_path": "arch/powerpc/kernel/vdso.c"
    },
    {
      "type": "modify",
      "old_id": "19e0ae9beecb71062f4a8030f6ab8df14bfa9d51",
      "old_mode": 33188,
      "old_path": "mm/memory.c",
      "new_id": "9aefaae4685812e12505551ade19ed6183220422",
      "new_mode": 33188,
      "new_path": "mm/memory.c"
    },
    {
      "type": "modify",
      "old_id": "449d77d409f52622bbf825b7fd17d43df7ff5fbf",
      "old_mode": 33188,
      "old_path": "mm/migrate.c",
      "new_id": "112bcaeaa1046076af8618b7f06b2cfbc32faf8a",
      "new_mode": 33188,
      "new_path": "mm/migrate.c"
    }
  ]
}
