The quilt patch titled Subject: mm, hwpoison: use num_poisoned_pages_sub() to decrease num_poisoned_pages has been removed from the -mm tree. Its filename was mm-hwpoison-use-num_poisoned_pages_sub-to-decrease-num_poisoned_pages.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@xxxxxxxxxx> Subject: mm, hwpoison: use num_poisoned_pages_sub() to decrease num_poisoned_pages Date: Tue, 30 Aug 2022 20:36:01 +0800 Use num_poisoned_pages_sub() to combine multiple atomic ops into one. Also num_poisoned_pages_dec() can be killed as there's no caller now. Link: https://lkml.kernel.org/r/20220830123604.25763-4-linmiaohe@xxxxxxxxxx Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx> Acked-by: Naoya Horiguchi <naoya.horiguchi@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/swapops.h | 5 ----- mm/memory-failure.c | 6 ++++-- 2 files changed, 4 insertions(+), 7 deletions(-) --- a/include/linux/swapops.h~mm-hwpoison-use-num_poisoned_pages_sub-to-decrease-num_poisoned_pages +++ a/include/linux/swapops.h @@ -485,11 +485,6 @@ static inline void num_poisoned_pages_in atomic_long_inc(&num_poisoned_pages); } -static inline void num_poisoned_pages_dec(void) -{ - atomic_long_dec(&num_poisoned_pages); -} - static inline void num_poisoned_pages_sub(long i) { atomic_long_sub(i, &num_poisoned_pages); --- a/mm/memory-failure.c~mm-hwpoison-use-num_poisoned_pages_sub-to-decrease-num_poisoned_pages +++ a/mm/memory-failure.c @@ -2602,7 +2602,7 @@ retry: void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) { - int i; + int i, total = 0; /* * A further optimization is to have per section refcounted @@ -2615,8 +2615,10 @@ void clear_hwpoisoned_pages(struct page for (i = 0; i < nr_pages; i++) { if (PageHWPoison(&memmap[i])) { - num_poisoned_pages_dec(); + total++; ClearPageHWPoison(&memmap[i]); } } + if (total) + num_poisoned_pages_sub(total); } _ Patches currently in -mm which might be from linmiaohe@xxxxxxxxxx are writeback-remove-unused-macro-dirty_full_scope.patch mm-page_alloc-ensure-kswapd-doesnt-accidentally-go-to-sleep.patch mm-page_alloc-make-zone_pcp_update-static.patch mm-remove-obsolete-macro-nr_pcp_order_mask-and-nr_pcp_order_width.patch mm-page_alloc-remove-obsolete-comment-in-zone_statistics.patch mm-page_alloc-add-__init-annotations-to-init_mem_debugging_and_hardening.patch mm-page_alloc-fix-freeing-static-percpu-memory.patch mm-remove-obsolete-pgdat_is_empty.patch mm-page_alloc-add-missing-is_migrate_isolate-check-in-set_page_guard.patch mm-page_alloc-use-local-variable-zone_idx-directly.patch mm-memory_hotplug-remove-obsolete-generic_free_nodedata.patch mm-page_alloc-make-boot_nodestats-static.patch mm-page_alloc-use-helper-macro-sz_1km.patch mm-page_alloc-init-local-variable-buddy_pfn.patch mm-page_alloc-use-costly_order-in-warn_on_once_gfp.patch mm-page_alloc-remove-obsolete-gfpflags_normal_context.patch mm-page_alloc-remove-obsolete-gfpflags_normal_context-fix.patch mm-page_alloc-fix-obsolete-comment-in-deferred_pfn_valid.patch