)]}'
{
  "commit": "b6999b19120931ede364fa3b685e698a61fed31d",
  "tree": "cadfc55786baf45ae05b02523d61e476eaf18154",
  "parents": [
    "09dc3cf93f7d16fdd37a0ad8486faebb5e2769ec"
  ],
  "author": {
    "name": "Youquan Song",
    "email": "youquan.song@intel.com",
    "time": "Thu Dec 08 14:34:16 2011 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Fri Dec 09 07:50:28 2011 -0800"
  },
  "message": "thp: add compound tail page _mapcount when mapped\n\nWith the 3.2-rc kernel, IOMMU 2M pages in KVM works.  But when I tried\nto use IOMMU 1GB pages in KVM, I encountered an oops and the 1GB page\nfailed to be used.\n\nThe root cause is that 1GB page allocation calls gup_huge_pud() while 2M\npage calls gup_huge_pmd.  If compound pages are used and the page is a\ntail page, gup_huge_pmd() increases _mapcount to record tail page are\nmapped while gup_huge_pud does not do that.\n\nSo when the mapped page is relesed, it will result in kernel oops\nbecause the page is not marked mapped.\n\nThis patch add tail process for compound page in 1GB huge page which\nkeeps the same process as 2M page.\n\nReproduce like:\n1. Add grub boot option: hugepagesz\u003d1G hugepages\u003d8\n2. mount -t hugetlbfs -o pagesize\u003d1G hugetlbfs /dev/hugepages\n3. qemu-kvm -m 2048 -hda os-kvm.img -cpu kvm64 -smp 4 -mem-path /dev/hugepages\n\t-net none -device pci-assign,host\u003d07:00.1\n\n  kernel BUG at mm/swap.c:114!\n  invalid opcode: 0000 [#1] SMP\n  Call Trace:\n    put_page+0x15/0x37\n    kvm_release_pfn_clean+0x31/0x36\n    kvm_iommu_put_pages+0x94/0xb1\n    kvm_iommu_unmap_memslots+0x80/0xb6\n    kvm_assign_device+0xba/0x117\n    kvm_vm_ioctl_assigned_device+0x301/0xa47\n    kvm_vm_ioctl+0x36c/0x3a2\n    do_vfs_ioctl+0x49e/0x4e4\n    sys_ioctl+0x5a/0x7c\n    system_call_fastpath+0x16/0x1b\n  RIP  put_compound_page+0xd4/0x168\n\nSigned-off-by: Youquan Song \u003cyouquan.song@intel.com\u003e\nReviewed-by: Andrea Arcangeli \u003caarcange@redhat.com\u003e\nCc: Andi Kleen \u003candi@firstfloor.org\u003e\nCc: \u003cstable@vger.kernel.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": "ea305856151cefc62fccd7f216519bc9d5f2945c",
      "old_mode": 33188,
      "old_path": "arch/x86/mm/gup.c",
      "new_id": "dd74e46828c0fc243740b61a18c2dea654fafb5e",
      "new_mode": 33188,
      "new_path": "arch/x86/mm/gup.c"
    }
  ]
}
