我最近将内核版本从 5.4.0-131 升级到了 5.4.0-132。升级后,我注意到了一些滞后行为,当我使用 检查内存使用情况时free -h
,它报告的总内存使用量为 2.2G。
我查看了dmesg
它所显示的有关记忆的内容:
[ 0.277055] Memory: 2158340K/33356064K available (14339K kernel code, 2375K rwdata, 9460K rodata, 2740K init, 4988K bss, 31197724K reserved, 0K cma-reserved)
为什么内核保留了超过30GB的内存?
与5.4.0-131相比,有很大区别:
[ 0.290845] Memory: 32491976K/33356064K available (14339K kernel code, 2375K rwdata, 9448K rodata, 2740K init, 4988K bss, 864088K reserved, 0K cma-reserved)
我比较/proc/iomem
了内核版本,没有发现明显差异。
我还可以检查什么来了解为什么内核在这个更高版本的内核中保留了如此多的内容?
编辑:我dmesg
也注意到了 132 内核中存在这个问题,这可能表明存在问题?-2 的限制对我来说听起来有点不对劲。
[ 0.015406] MEMBLOCK configuration:
[ 0.015407] memory size = 0x00000007f3e48000 reserved size = 0xffffffff4fff5e19
[ 0.015408] memory.cnt = 0x7
[ 0.015410] memory[0x0] [0x0000000000001000-0x000000000005bfff], 0x000000000005b000 bytes flags: 0x0
[ 0.015411] memory[0x1] [0x000000000005d000-0x000000000009ffff], 0x0000000000043000 bytes flags: 0x0
[ 0.015413] memory[0x2] [0x0000000000100000-0x00000000970f1fff], 0x0000000096ff2000 bytes flags: 0x0
[ 0.015414] memory[0x3] [0x00000000970f3000-0x0000000097903fff], 0x0000000000811000 bytes flags: 0x0
[ 0.015415] memory[0x4] [0x0000000097905000-0x00000000b66aafff], 0x000000001eda6000 bytes flags: 0x0
[ 0.015416] memory[0x5] [0x00000000b7c0f000-0x00000000b7c0ffff], 0x0000000000001000 bytes flags: 0x0
[ 0.015417] memory[0x6] [0x0000000100000000-0x000000083d7fffff], 0x000000073d800000 bytes flags: 0x0
[ 0.015418] reserved.cnt = 0x6
[ 0.015420] reserved[0x0] [0x0000000000000000-0x0000000000000fff], 0x0000000000001000 bytes flags: 0x0
[ 0.015421] reserved[0x1] [0x000000003a3e2000-0x000000003d08bfff], 0x0000000002caa000 bytes flags: 0x0
[ 0.015422] reserved[0x2] [0x00000000a09ef018-0x00000000a09efbb7], 0x0000000000000ba0 bytes flags: 0x0
[ 0.015423] reserved[0x3] [0x00000000a09f0018-0x00000000a0a00057], 0x0000000000010040 bytes flags: 0x0
[ 0.015425] reserved[0x4] [0x00000000a4f9d018-0x00000000a4fa5269], 0x0000000000008252 bytes flags: 0x0
[ 0.015426] reserved[0x5] [0x00000000b2cce018-0xfffffffffffffffe], 0xffffffff4d331fe7 bytes flags: 0x0