mm/khugepaged: refactor collapse_file control flow
authorDavid Stevens <stevensd@chromium.org>
Tue, 4 Apr 2023 12:01:15 +0000 (21:01 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 18 Apr 2023 23:29:52 +0000 (16:29 -0700)
commitcae106dd67b99a65d117a9f6c977a86b120dad61
tree952432ff85a1c19ab3067a63e972ce1edd32c8da
parentefa3d814fad151ed5209539ecc1fc2880f7680b2
mm/khugepaged: refactor collapse_file control flow

Add a rollback label to deal with failure, instead of continuously
checking for RESULT_SUCCESS, to make it easier to add more failure cases.
The refactoring also allows the collapse_file tracepoint to include hpage
on success (instead of NULL).

Link: https://lkml.kernel.org/r/20230404120117.2562166-3-stevensd@google.com
Signed-off-by: David Stevens <stevensd@chromium.org>
Acked-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Yang Shi <shy828301@gmail.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jiaqi Yan <jiaqiyan@google.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/khugepaged.c