Commit 596500bd authored by Liu Shixin's avatar Liu Shixin
Browse files

dhugetlb: skip unexpected migration

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


CVE: NA

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

With dynamic hugetlb feature, some memory is isolated in the dynamic pool.
When try to compact memory, the kcompactd thread will scan all memory,
althougt some memory is belonging to dynamic pool, kcompactd still try to
migrate them. After migration, these memory will free to dynamic pool
rather than buddy system, which results the free pages in buddy system
decreased.

Since it is unnecessary to compact the memory in the dynamic pool, skip
migrate them to fix the problem.

The same problem also existed in alloc_contig_range(), offline_pages() and
numa balancing. Skip it again in these three scenarios.

In addition to this, we have to consider the migration of hugepage, if
a hugepage is from dynamic pool, we should not allow to migrate it.

Fixes: 0bc0d0d5 ("dhugetlb: backport dynamic hugetlb feature")
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent 096ad875
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment