projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4800179
)
mm/page_alloc: update comments in __free_pages_ok()
author
Deyan Wang
<wonder_rock@126.com>
Thu, 1 Dec 2022 13:50:45 +0000
(21:50 +0800)
committer
Andrew Morton
<akpm@linux-foundation.org>
Mon, 12 Dec 2022 02:12:17 +0000
(18:12 -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@126.com
Signed-off-by: Deyan Wang <wonder_rock@126.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c
patch
|
blob
|
history
diff --git
a/mm/page_alloc.c
b/mm/page_alloc.c
index
5ab9dd2
..
0745aed
100644
(file)
--- a/
mm/page_alloc.c
+++ b/
mm/page_alloc.c
@@
-1702,6
+1702,11
@@
static void __free_pages_ok(struct page *page, unsigned int order,
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);