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: cdbeee51d044 ("mm/dynamic_hugetlb: add migration function") Signed-off-by: Liu Shixin liushixin2@huawei.com --- mm/dynamic_hugetlb.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/mm/dynamic_hugetlb.c b/mm/dynamic_hugetlb.c index fd8a994ecf63..bf217db405fb 100644 --- a/mm/dynamic_hugetlb.c +++ b/mm/dynamic_hugetlb.c @@ -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