mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
mm/hugetlb: optimize the surplus state transfer code in move_hugetlb_state()
We should not transfer the per-node surplus state when we do not cross the node in order to save some cpu cycles Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Miaohe Lin <[email protected]> Reviewed-by: Mike Kravetz <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
04adbc3f7b
commit
5af1ab1d24
1 file changed
+6
@@ -5682,6 +5682,12 @@ void move_hugetlb_state(struct page *oldpage, struct page *newpage, int reason)
|
||||
SetHPageTemporary(oldpage);
|
||||
ClearHPageTemporary(newpage);
|
||||
|
||||
/*
|
||||
* There is no need to transfer the per-node surplus state
|
||||
* when we do not cross the node.
|
||||
*/
|
||||
if (new_nid == old_nid)
|
||||
return;
|
||||
spin_lock(&hugetlb_lock);
|
||||
if (h->surplus_huge_pages_node[old_nid]) {
|
||||
h->surplus_huge_pages_node[old_nid]--;
|
||||
|
||||
Reference in new issue
Block a user