我在分配了 70 MiB 内存的虚拟机中运行 Debian Buster。奇怪的是,它可以正常启动并运行,但当我尝试关闭它时会出现恐慌。
这是恐慌的日志,我使用串行捕获本指南。
[ 13.862707] Out of memory: Kill process 162 (systemd-journal) score 30 or sacrifice child
[ 13.864027] Killed process 162 (systemd-journal) total-vm:28632kB, anon-rss:1040kB, file-rss:0kB, shmem-rss:324kB
[ 13.874500] Out of memory: Kill process 392 (systemd-udevd) score 20 or sacrifice child
[ 13.875658] Killed process 392 (systemd-udevd) total-vm:21924kB, anon-rss:916kB, file-rss:24kB, shmem-rss:0kB
[ 13.990890] Kernel panic - not syncing: System is deadlocked on memory
[ 13.990890]
[ 13.992035] CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 4.19.0-9-amd64 #1 Debian 4.19.118-2+deb10u1
[ 13.993291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
[ 13.994761] Call Trace:
[ 13.995061] dump_stack+0x66/0x90
[ 13.995541] panic+0xe7/0x24a
[ 13.996081] out_of_memory.cold.33+0x2f/0x82
[ 13.996721] __alloc_pages_slowpath+0xbd8/0xcb0
[ 13.997255] __alloc_pages_nodemask+0x28b/0x2b0
[ 13.997886] filemap_fault+0x333/0x780
[ 13.998409] ? alloc_set_pte+0x49e/0x560
[ 13.998926] ? filemap_map_pages+0x1ed/0x3a0
[ 13.999569] ext4_filemap_fault+0x2c/0x40 [ext4]
[ 14.000265] __do_fault+0x36/0x130
[ 14.000856] __handle_mm_fault+0xe6c/0x1270
[ 14.001644] ? isolate_lru_page+0x1c7/0x260
[ 14.002426] handle_mm_fault+0xd6/0x200
[ 14.003140] __get_user_pages+0x23a/0x6c0
[ 14.003908] populate_vma_page_range+0x6d/0x70
[ 14.004747] __mm_populate+0x9d/0x140
[ 14.005422] __x64_sys_mlockall+0xf1/0x180
[ 14.006191] do_syscall_64+0x53/0x110
[ 14.006889] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 14.007823] RIP: 0033:0x7ff835b5f3c7
[ 14.008494] Code: 73 01 c3 48 8b 0d c9 6a 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 97 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 99 6a 0c 00 f7 d8 64 89 01 48
[ 14.011333] RSP: 002b:00007ffca4ff9128 EFLAGS: 00000246 ORIG_RAX: 0000000000000097
[ 14.012373] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff835b5f3c7
[ 14.013393] RDX: 0000000000008000 RSI: 000029b92070b2da RDI: 0000000000000003
[ 14.014361] RBP: 0000563f14544420 R08: 000000000000021f R09: 0000563f15281290
[ 14.016407] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
[ 14.017351] R13: 00007ffca4ff94b0 R14: 0000000000000000 R15: 0000000000000000
[ 14.018434] Kernel Offset: 0x39800000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[ 14.020004] ---[ end Kernel panic - not syncing: System is deadlocked on memory
[ 14.020004] ]---
除了给它更多的内存之外,还有什么想法可以防止它在关机期间出现恐慌?