mm/huge_memory: minor cleanup for split_huge_pages_all
authorMiaohe Lin <linmiaohe@huawei.com>
Mon, 4 Jul 2022 13:21:57 +0000 (21:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Oct 2022 07:53:28 +0000 (09:53 +0200)
commitf1d6894159fc4164647f6b0e9a0a49b18ae64feb
tree351258a289ab164c4f5586bead589b6c8435ccf7
parent7190afd4cd5ff3b94efb1032b6cd4572c2141373
mm/huge_memory: minor cleanup for split_huge_pages_all

[ Upstream commit a17206dac7b262e7abed5a05e34a6bd6bd0a9b06 ]

There is nothing to do if a zone doesn't have any pages managed by the
buddy allocator. So we should check managed_zone instead. Also if a thp
is found, there's no need to traverse the subpages again.

Link: https://lkml.kernel.org/r/20220704132201.14611-13-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Zach O'Keefe <zokeefe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 2b7aa91ba0e8 ("mm/huge_memory: use pfn_to_online_page() in split_huge_pages_all()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
mm/huge_memory.c