Bug 4206 - [Bugfix] 调小3435对sev crashkernel的预留内存
Summary: [Bugfix] 调小3435对sev crashkernel的预留内存
Status: RESOLVED FIXED
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: ARCH(unspecified) (show other bugs) ARCH(unspecified)
Version: 5.10.y-14
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: maqiao
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-24 10:39 UTC by zeyuzhang
Modified: 2023-02-28 19:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zeyuzhang 2023-02-24 10:39:33 UTC
测试中发现2C-8C的sev实例在kdump下会oom,排查发现alinux3对于2c-8c配置的crashkernel大小默认为192MB,实测中发现至少需要需要214MB才不会oom。最终原因定位为开启sev情况下有未知情况会带来内存损耗,调大crashkernel即可。

测试中同时发现kdump启动的内核也会默认分配64MB内存给swiotlb(crashkernel配置的1/3),因此引入了3435带来的改动,sev使能情况下会默会调大crashkernel的大小,增大的部分和swiotlb的大小相同。

但是commit abee86566234会默认调整sev实例的swiotlb大小为[totoal_mem*6%, 1G],因此对于一个8C的实例,其swiotlb大小约为512MB,而额外调大的crashkernel大小也为512MB,实际预留的crashkernel大小为512+192=70MB,这显然造成了严重的内存浪费。

commit 3ee7f0f32763对crashkernel配置的内存大小进行了限制(最大256MB),但该数值也过大,测试中发现总共预留了约256+256=512MB内存为crashkernel,显然这至少超出了实际需要的一倍。并且由于预留的内存过多,在小规格实例上可以看到下降的内存尤为明显。

因此需要revert掉commit abee86566234和commit 3ee7f0f32763,或调小256MB的默认设置。
Comment 1 maqiao alibaba_cloud_group 2023-02-28 19:39:43 UTC
merged: https://gitee.com/anolis/cloud-kernel/pulls/1272