]> git.ipfire.org Git - thirdparty/linux.git/commit
mm: migrate: remove isolated variable in add_page_for_migration()
authorKefeng Wang <wangkefeng.wang@huawei.com>
Wed, 13 Sep 2023 09:51:31 +0000 (17:51 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 4 Oct 2023 17:32:28 +0000 (10:32 -0700)
commitfa1df3f6287e1e1fd8b5309828238e2c728e985f
treecd02a7c4b04054491a97893d53d31030d2d38803
parentb426ed7889be80359cb4edef142e5c5fa697b068
mm: migrate: remove isolated variable in add_page_for_migration()

Directly check the return of isolate_hugetlb() and folio_isolate_lru() to
remove isolated variable, also setup err = -EBUSY in advance before
isolation, and update err only when successfully queued for migration,
which could help us to unify and simplify code a bit.

Link: https://lkml.kernel.org/r/20230913095131.2426871-9-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/migrate.c