Commit 9fbf9524 authored by Wang Wensheng's avatar Wang Wensheng Committed by Zheng Zengkai
Browse files

share_pool: Compact memory when necessary

ascend inclusion
category: Feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4NDAW


CVE: NA

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

When the memory is insufficient or fragmentation is severe,
the 2MB hugepage allocation will perform direct reclaim and
compact.

The direct reclaim and compact may take a long time. As a
result, sp mutex will be hold for too long time to casue
the hung task problem. In this case, set the PF_MEMALLOC
flag to prevent the direct reclaim and compact from being
executed.

Direct compact is not allowed during hugepage allocation.
As a result, 2MB hugepage may failed to be applied for.

When do sp alloc, if the 2MB hugepage cannot be allocated
of the total free memory is less than 1/3 of total memory,
a work is added compact the memory asynchronously.

When do sp free, if the total free memory is less than 1/3
of total memory, compact memory synchronously.

We can disable this and change the compact frequence through sysctl.

Signed-off-by: default avatarZhou Guanghui <zhouguanghui1@huawei.com>
Signed-off-by: default avatarWang Wensheng <wangwensheng4@huawei.com>
Reviewed-by: default avatarKefeng <Wang&lt;wangkefeng.wang@huawei.com>
Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent c78d78c7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment