* [merged mm-stable] mm-page_alloc-avoid-unneeded-alike_pages-calculation.patch removed from -mm tree
@ 2023-08-21 20:39 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-08-21 20:39 UTC (permalink / raw)
To: mm-commits, linmiaohe, akpm
The quilt patch titled
Subject: mm/page_alloc: avoid unneeded alike_pages calculation
has been removed from the -mm tree. Its filename was
mm-page_alloc-avoid-unneeded-alike_pages-calculation.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Miaohe Lin <linmiaohe@huawei.com>
Subject: mm/page_alloc: avoid unneeded alike_pages calculation
Date: Tue, 1 Aug 2023 20:37:23 +0800
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 | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
--- a/mm/page_alloc.c~mm-page_alloc-avoid-unneeded-alike_pages-calculation
+++ a/mm/page_alloc.c
@@ -1833,6 +1833,10 @@ static void steal_suitable_fallback(stru
free_pages = move_freepages_block(zone, page, start_type,
&movable_pages);
+ /* moving whole block can fail due to zone boundary conditions */
+ if (!free_pages)
+ goto single_page;
+
/*
* Determine how many pages are compatible with our allocation.
* For movable allocation, it's the number of movable pages which
@@ -1854,14 +1858,9 @@ static void steal_suitable_fallback(stru
else
alike_pages = 0;
}
-
- /* moving whole block can fail due to zone boundary conditions */
- if (!free_pages)
- goto single_page;
-
/*
* If a sufficient number of pages in the block are either free or of
- * comparable migratability as our allocation, claim the whole block.
+ * compatible migratability as our allocation, claim the whole block.
*/
if (free_pages + alike_pages >= (1 << (pageblock_order-1)) ||
page_group_by_mobility_disabled)
_
Patches currently in -mm which might be from linmiaohe@huawei.com are
mm-memory-failure-add-pageoffline-check.patch
mm-memory-failure-fix-potential-page-refcnt-leak-in-memory_failure.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-21 20:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-21 20:39 [merged mm-stable] mm-page_alloc-avoid-unneeded-alike_pages-calculation.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.