Message ID | 20220427190036.7262CC385A9@smtp.kernel.org |
---|---|
State | New |
Headers | show |
Series | + mm-huge_memory-do-not-overkill-when-splitting-huge_zero_page.patch added to -mm tree | expand |
--- a/mm/huge_memory.c~mm-huge_memory-do-not-overkill-when-splitting-huge_zero_page +++ a/mm/huge_memory.c @@ -2495,11 +2495,16 @@ int split_huge_page_to_list(struct page struct address_space *mapping = NULL; int extra_pins, ret; pgoff_t end; + bool is_hzp; - VM_BUG_ON_PAGE(is_huge_zero_page(head), head); VM_BUG_ON_PAGE(!PageLocked(head), head); VM_BUG_ON_PAGE(!PageCompound(head), head); + is_hzp = is_huge_zero_page(head); + VM_WARN_ON_ONCE_PAGE(is_hzp, head); + if (is_hzp) + return -EBUSY; + if (PageWriteback(head)) return -EBUSY;