Re: [v4 PATCH 1/2] mm: thp: replace DEBUG_VM BUG with VM_WARN when unmap fails for split

From: Kirill A. Shutemov
Date: Thu May 27 2021 - 06:52:13 EST


On Wed, May 26, 2021 at 01:12:38PM -0700, Yang Shi wrote:
> When debugging the bug reported by Wang Yugui [1], try_to_unmap() may
> fail, but the first VM_BUG_ON_PAGE() just checks page_mapcount() however
> it may miss the failure when head page is unmapped but other subpage is
> mapped. Then the second DEBUG_VM BUG() that check total mapcount would
> catch it. This may incur some confusion. And this is not a fatal issue,
> so consolidate the two DEBUG_VM checks into one VM_WARN_ON_ONCE_PAGE().
>
> [1] https://lore.kernel.org/linux-mm/20210412180659.B9E3.409509F4@xxxxxxxxxxxx/
>
> Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
> Signed-off-by: Yang Shi <shy828301@xxxxxxxxx>

For both patches:

Acked-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>

--
Kirill A. Shutemov