提交 ac4b2901 编写于 作者: D Deyan Wang 提交者: Andrew Morton

mm/page_alloc: update comments in __free_pages_ok()

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@126.comSigned-off-by: NDeyan Wang <wonder_rock@126.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
上级 48001795
...@@ -1702,6 +1702,11 @@ static void __free_pages_ok(struct page *page, unsigned int order, ...@@ -1702,6 +1702,11 @@ static void __free_pages_ok(struct page *page, unsigned int order,
if (!free_pages_prepare(page, order, true, fpi_flags)) if (!free_pages_prepare(page, order, true, fpi_flags))
return; 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); migratetype = get_pfnblock_migratetype(page, pfn);
spin_lock_irqsave(&zone->lock, flags); spin_lock_irqsave(&zone->lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册