The quilt patch titled Subject: mm/page_alloc: leave IRQs enabled for per-cpu page allocations -fix has been removed from the -mm tree. Its filename was mm-page_alloc-leave-irqs-enabled-for-per-cpu-page-allocations-fix.patch This patch was dropped because it was folded into mm-page_alloc-leave-irqs-enabled-for-per-cpu-page-allocations.patch ------------------------------------------------------ From: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Subject: mm/page_alloc: leave IRQs enabled for per-cpu page allocations -fix Date: Tue, 22 Nov 2022 13:12:28 +0000 As noted by Vlastimil Babka, the migratetype might be wrong if a PCP was not locked so check the migrate type early. Similarly the !pcp check is generally unlikely so explicitly tagging it makes sense. This is a fix for the mm-unstable patch mm-page_alloc-leave-irqs-enabled-for-per-cpu-page-allocations.patch Link: https://lkml.kernel.org/r/20221122131229.5263-2-mgorman@xxxxxxxxxxxxxxxxxxx Reported-by: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Acked-by: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/page_alloc.c~mm-page_alloc-leave-irqs-enabled-for-per-cpu-page-allocations-fix +++ a/mm/page_alloc.c @@ -3523,6 +3523,7 @@ void free_unref_page_list(struct list_he struct zone *zone = page_zone(page); list_del(&page->lru); + migratetype = get_pcppage_migratetype(page); /* Different zone, different pcp lock. */ if (zone != locked_zone) { @@ -3537,7 +3538,7 @@ void free_unref_page_list(struct list_he */ pcp_trylock_prepare(UP_flags); pcp = pcp_spin_trylock(zone->per_cpu_pageset); - if (!pcp) { + if (unlikely(!pcp)) { pcp_trylock_finish(UP_flags); free_one_page(zone, page, page_to_pfn(page), 0, migratetype, FPI_NONE); @@ -3552,7 +3553,6 @@ void free_unref_page_list(struct list_he * Non-isolated types over MIGRATE_PCPTYPES get added * to the MIGRATE_MOVABLE pcp list. */ - migratetype = get_pcppage_migratetype(page); if (unlikely(migratetype >= MIGRATE_PCPTYPES)) migratetype = MIGRATE_MOVABLE; _ Patches currently in -mm which might be from mgorman@xxxxxxxxxxxxxxxxxxx are mm-page_alloc-always-remove-pages-from-temporary-list.patch mm-page_alloc-leave-irqs-enabled-for-per-cpu-page-allocations.patch mm-page_alloc-simplify-locking-during-free_unref_page_list.patch