Commit d6c855d7 authored by Liu Shixin's avatar Liu Shixin Committed by openeuler-sync-bot
Browse files

mm/dynamic_hugetlb: add lru_add_drain_all() before migration

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9K8D1


CVE: NA

--------------------------------

Since the pages in pagevec will failed to isolate, call lru_add_drain_all()
before migration can increase the probability of migration success.

Fixes: cdbeee51 ("mm/dynamic_hugetlb: add migration function")
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
(cherry picked from commit b35f2c3c)
parent a00c8f70
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#include <linux/migrate.h>
#include <linux/memblock.h>
#include <linux/memory_hotplug.h>
#include <linux/swap.h>
#include <linux/dynamic_hugetlb.h>

#include "internal.h"
@@ -365,6 +366,7 @@ static int hpool_merge_page(struct dhugetlb_pool *hpool, int hpages_pool_idx, bo
			p = pfn_to_page(split_page->start_pfn + i);
			if (PagePool(p)) {
				cond_resched();
				lru_add_drain_all();
				/*
				 * TODO: fatal migration failures should bail
				 * out