mm/page_alloc: avoid unneeded alike_pages calculation
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 1 Aug 2023 12:37:23 +0000 (20:37 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 21 Aug 2023 20:37:32 +0000 (13:37 -0700)
commitebddd111fcd13fefd7350f77201dfc5605672909
tree69c3d3111aa489e9e7ffbc82ac7ebaca3f3c53cd
parent549f5c771e1be6985c29d5f1e0bbba11a8897ec8
mm/page_alloc: avoid unneeded alike_pages calculation

When free_pages is 0, alike_pages is not used.  So alike_pages calculation
can be avoided by checking free_pages early to save cpu cycles.  Also fix
typo 'comparable'.  It should be 'compatible' here.

Link: https://lkml.kernel.org/r/20230801123723.2225543-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c