The patch titled Subject: mm/thp: remove code path which never got into has been added to the -mm tree. Its filename is mm-thp-remove-code-path-which-never-got-into.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-thp-remove-code-path-which-never-got-into.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-thp-remove-code-path-which-never-got-into.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx> Subject: mm/thp: remove code path which never got into split_huge_page() will never call on a page which isn't on lru list, so this code never got a chance to run, and should not be run, to add tail pages on a lru list which head page isn't there. Although the bug was never triggered, it'better be removed for code correctness, and add a warn for unexpected calling. Link: http://lkml.kernel.org/r/1597144232-11370-5-git-send-email-alex.shi@xxxxxxxxxxxxxxxxx Signed-off-by: Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx> Reviewed-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Roman Gushchin <guro@xxxxxx> Cc: Vladimir Davydov <vdavydov.dev@xxxxxxxxx> Cc: Wei Yang <richard.weiyang@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/huge_memory.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) --- a/mm/huge_memory.c~mm-thp-remove-code-path-which-never-got-into +++ a/mm/huge_memory.c @@ -2330,17 +2330,8 @@ static void lru_add_page_tail(struct pag /* page reclaim is reclaiming a huge page */ get_page(page_tail); list_add_tail(&page_tail->lru, list); - } else { - /* - * Head page has not yet been counted, as an hpage, - * so we must account for each subpage individually. - * - * Put page_tail on the list at the correct position - * so they all end up in order. - */ - add_page_to_lru_list_tail(page_tail, lruvec, - page_lru(page_tail)); - } + } else + VM_WARN_ON(!PageLRU(head)); } static void __split_huge_page_tail(struct page *head, int tail, _ Patches currently in -mm which might be from alex.shi@xxxxxxxxxxxxxxxxx are mm-memcg-warning-on-memcg-after-readahead-page-charged.patch mm-memcg-remove-useless-check-on-page-mem_cgroup.patch mm-thp-move-lru_add_page_tail-func-to-huge_memoryc.patch mm-thp-clean-up-lru_add_page_tail.patch mm-thp-remove-code-path-which-never-got-into.patch mm-thp-narrow-lru-locking.patch