)]}'
{
  "commit": "cdfd4325c0d878679bd6a3ba8285b71d9980e3c0",
  "tree": "1b1d52ce2ac528851630c706fbcf9db1072460a5",
  "parents": [
    "e7c4b0bfd025f71cf7624b7c1be174f63caade33"
  ],
  "author": {
    "name": "Andy Whitcroft",
    "email": "apw@shadowen.org",
    "time": "Wed Jul 23 21:27:28 2008 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Thu Jul 24 10:47:16 2008 -0700"
  },
  "message": "mm: record MAP_NORESERVE status on vmas and fix small page mprotect reservations\n\nWith Mel\u0027s hugetlb private reservation support patches applied, strict\novercommit semantics are applied to both shared and private huge page\nmappings.  This can be a problem if an application relied on unlimited\novercommit semantics for private mappings.  An example of this would be an\napplication which maps a huge area with the intention of using it very\nsparsely.  These application would benefit from being able to opt-out of\nthe strict overcommit.  It should be noted that prior to hugetlb\nsupporting demand faulting all mappings were fully populated and so\napplications of this type should be rare.\n\nThis patch stack implements the MAP_NORESERVE mmap() flag for huge page\nmappings.  This flag has the same meaning as for small page mappings,\nsuppressing reservations for that mapping.\n\nThanks to Mel Gorman for reviewing a number of early versions of these\npatches.\n\nThis patch:\n\nWhen a small page mapping is created with mmap() reservations are created\nby default for any memory pages required.  When the region is read/write\nthe reservation is increased for every page, no reservation is needed for\nread-only regions (as they implicitly share the zero page).  Reservations\nare tracked via the VM_ACCOUNT vma flag which is present when the region\nhas reservation backing it.  When we convert a region from read-only to\nread-write new reservations are aquired and VM_ACCOUNT is set.  However,\nwhen a read-only map is created with MAP_NORESERVE it is indistinguishable\nfrom a normal mapping.  When we then convert that to read/write we are\nforced to incorrectly create reservations for it as we have no record of\nthe original MAP_NORESERVE.\n\nThis patch introduces a new vma flag VM_NORESERVE which records the\npresence of the original MAP_NORESERVE flag.  This allows us to\ndistinguish these two circumstances and correctly account the reserve.\n\nAs well as fixing this FIXME in the code, this makes it much easier to\nintroduce MAP_NORESERVE support for huge pages as this flag is available\nconsistantly for the life of the mapping.  VM_ACCOUNT on the other hand is\nheavily used at the generic level in association with small pages.\n\nSigned-off-by: Andy Whitcroft \u003capw@shadowen.org\u003e\nCc: Mel Gorman \u003cmel@csn.ul.ie\u003e\nCc: Adam Litke \u003cagl@us.ibm.com\u003e\nCc: Johannes Weiner \u003channes@saeurebad.de\u003e\nCc: Andy Whitcroft \u003capw@shadowen.org\u003e\nCc: William Lee Irwin III \u003cwli@holomorphy.com\u003e\nCc: Hugh Dickins \u003chugh@veritas.com\u003e\nCc: Michael Kerrisk \u003cmtk.manpages@googlemail.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": "196924b657bcc763ccdbf3f8a5e680773402cfa2",
      "old_mode": 33188,
      "old_path": "include/linux/mm.h",
      "new_id": "df322fb4df31f1a7cd507ea0f2c4993a59a23da3",
      "new_mode": 33188,
      "new_path": "include/linux/mm.h"
    },
    {
      "type": "modify",
      "old_id": "75e0d0673d78a3bf203e7ca8d0f632789d0c32c7",
      "old_mode": 33188,
      "old_path": "mm/mmap.c",
      "new_id": "57d3b6097deb38e3f73d3319845681207b86c293",
      "new_mode": 33188,
      "new_path": "mm/mmap.c"
    },
    {
      "type": "modify",
      "old_id": "360d9cc8b38c061185d562fc40b7f032ae34d21d",
      "old_mode": 33188,
      "old_path": "mm/mprotect.c",
      "new_id": "abd645a3b0a021bb34d5de49cff94efae109966c",
      "new_mode": 33188,
      "new_path": "mm/mprotect.c"
    }
  ]
}
