)]}'
{
  "commit": "eac96c3efdb593df1a57bb5b95dbe037bfa9a522",
  "tree": "c24408ca87d4c74b41d3a05e55d337b3af528b6f",
  "parents": [
    "c7cb42e94473aafe553c0f2a3d8ca904599399ed"
  ],
  "author": {
    "name": "Yang Shi",
    "email": "shy828301@gmail.com",
    "time": "Thu Oct 28 14:36:11 2021 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Thu Oct 28 17:18:55 2021 -0700"
  },
  "message": "mm: filemap: check if THP has hwpoisoned subpage for PMD page fault\n\nWhen handling shmem page fault the THP with corrupted subpage could be\nPMD mapped if certain conditions are satisfied.  But kernel is supposed\nto send SIGBUS when trying to map hwpoisoned page.\n\nThere are two paths which may do PMD map: fault around and regular\nfault.\n\nBefore commit f9ce0be71d1f (\"mm: Cleanup faultaround and finish_fault()\ncodepaths\") the thing was even worse in fault around path.  The THP\ncould be PMD mapped as long as the VMA fits regardless what subpage is\naccessed and corrupted.  After this commit as long as head page is not\ncorrupted the THP could be PMD mapped.\n\nIn the regular fault path the THP could be PMD mapped as long as the\ncorrupted page is not accessed and the VMA fits.\n\nThis loophole could be fixed by iterating every subpage to check if any\nof them is hwpoisoned or not, but it is somewhat costly in page fault\npath.\n\nSo introduce a new page flag called HasHWPoisoned on the first tail\npage.  It indicates the THP has hwpoisoned subpage(s).  It is set if any\nsubpage of THP is found hwpoisoned by memory failure and after the\nrefcount is bumped successfully, then cleared when the THP is freed or\nsplit.\n\nThe soft offline path doesn\u0027t need this since soft offline handler just\nmarks a subpage hwpoisoned when the subpage is migrated successfully.\nBut shmem THP didn\u0027t get split then migrated at all.\n\nLink: https://lkml.kernel.org/r/20211020210755.23964-3-shy828301@gmail.com\nFixes: 800d8c63b2e9 (\"shmem: add huge pages support\")\nSigned-off-by: Yang Shi \u003cshy828301@gmail.com\u003e\nReviewed-by: Naoya Horiguchi \u003cnaoya.horiguchi@nec.com\u003e\nSuggested-by: Kirill A. Shutemov \u003ckirill.shutemov@linux.intel.com\u003e\nCc: Hugh Dickins \u003chughd@google.com\u003e\nCc: Matthew Wilcox \u003cwilly@infradead.org\u003e\nCc: Oscar Salvador \u003cosalvador@suse.de\u003e\nCc: Peter Xu \u003cpeterx@redhat.com\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": "a558d67ee86f50fdbe3a13833841baf2945a1ed6",
      "old_mode": 33188,
      "old_path": "include/linux/page-flags.h",
      "new_id": "fbfd3fad48f21d05e9eccd5836f472f723970497",
      "new_mode": 33188,
      "new_path": "include/linux/page-flags.h"
    },
    {
      "type": "modify",
      "old_id": "92192cb086c79a2f675e9b412b938ada20cb216f",
      "old_mode": 33188,
      "old_path": "mm/huge_memory.c",
      "new_id": "c5142d237e482fee8c2eb5277a67cddf8bc136e8",
      "new_mode": 33188,
      "new_path": "mm/huge_memory.c"
    },
    {
      "type": "modify",
      "old_id": "73f68699e7ab4219d554d546f73b30bf33059850",
      "old_mode": 33188,
      "old_path": "mm/memory-failure.c",
      "new_id": "bdbbb32211a586d03dbc79604c4c670d9542b03e",
      "new_mode": 33188,
      "new_path": "mm/memory-failure.c"
    },
    {
      "type": "modify",
      "old_id": "adf9b9ef8277da3dab7500ee26b0067bd6763e71",
      "old_mode": 33188,
      "old_path": "mm/memory.c",
      "new_id": "c52be6d6b6055f0b99cf2c4cc8ca18bc7521110e",
      "new_mode": 33188,
      "new_path": "mm/memory.c"
    },
    {
      "type": "modify",
      "old_id": "3ec39552d00f6fca35807c33a48613e4f34bfd37",
      "old_mode": 33188,
      "old_path": "mm/page_alloc.c",
      "new_id": "23d3339ac4e8e25b7945788014e882fbb0833348",
      "new_mode": 33188,
      "new_path": "mm/page_alloc.c"
    }
  ]
}
