The patch titled Subject: mm/page_alloc: update comments in __free_pages_ok() has been added to the -mm mm-unstable branch. Its filename is mm-page_alloc-update-comments-in-__free_pages_ok.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-page_alloc-update-comments-in-__free_pages_ok.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Deyan Wang <wonder_rock@xxxxxxx> Subject: mm/page_alloc: update comments in __free_pages_ok() Date: Thu, 1 Dec 2022 21:50:45 +0800 Add a comment to explain why we call get_pfnblock_migratetype() twice in __free_pages_ok(). Link: https://lkml.kernel.org/r/20221201135045.31663-1-wonder_rock@xxxxxxx Signed-off-by: Deyan Wang <wonder_rock@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/mm/page_alloc.c~mm-page_alloc-update-comments-in-__free_pages_ok +++ a/mm/page_alloc.c @@ -1702,6 +1702,11 @@ static void __free_pages_ok(struct page if (!free_pages_prepare(page, order, true, fpi_flags)) return; + /* + * Calling get_pfnblock_migratetype() without spin_lock_irqsave() here + * is used to avoid calling get_pfnblock_migratetype() under the lock. + * This will reduce the lock holding time. + */ migratetype = get_pfnblock_migratetype(page, pfn); spin_lock_irqsave(&zone->lock, flags); _ Patches currently in -mm which might be from wonder_rock@xxxxxxx are mm-page_alloc-update-comments-in-__free_pages_ok.patch