Message ID | 20210308112809.26107-3-linmiaohe@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Some cleanups for hugetlb | expand |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 33a3edf79022..695603071f2c 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5621,6 +5621,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]--;