mm: memory-failure: use local variable huge to check hugetlb page
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 11 Jul 2023 05:50:12 +0000 (13:50 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 18 Aug 2023 17:12:19 +0000 (10:12 -0700)
commit55c7ac4527086d52dedc5da4ee3d676bcc9a7691
tree2b9da0860dcb6d8b75517503e9b018dd666b8fce
parent80ee7cb271b52e5861eda3c67731c95fd55a2627
mm: memory-failure: use local variable huge to check hugetlb page

Use local variable huge to check whether page is hugetlb page to avoid
calling PageHuge() multiple times to save cpu cycles.  PageHuge() will be
stable while extra page refcnt is held.

Link: https://lkml.kernel.org/r/20230711055016.2286677-5-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c