在某些 ML 训练期间htop
,当 OOM 发生时,显示所有 RAM (16GB) 和仅 2G(16GB 中)的 SWAP 的使用情况。
dmesg
显示:
[pon sie 12 11:53:44 2019] Purging GPU memory, 0 bytes freed, 131072 bytes still pinned.
[pon sie 12 11:53:44 2019] 73728 and 0 bytes still available in the bound and unbound GPU page lists.
[pon sie 12 11:53:44 2019] iscsid invoked oom-killer: gfp_mask=0x24200ca, order=0, oom_score_adj=0
[pon sie 12 11:53:44 2019] iscsid cpuset=/ mems_allowed=0
[pon sie 12 11:53:44 2019] CPU: 1 PID: 1306 Comm: iscsid Tainted: P OE 4.4.0-116-generic #140-Ubuntu
[pon sie 12 11:53:44 2019] Hardware name: MSI MS-7996/H110M PRO-VD (MS-7996), BIOS 2.E0 08/11/2017
[pon sie 12 11:53:44 2019] 0000000000000286 faad9ce5c4d517dc ffff8804677a79d8 ffffffff813ffc13
[pon sie 12 11:53:44 2019] ffff8804677a7b90 ffff880464551e00 ffff8804677a7a48 ffffffff8121012e
[pon sie 12 11:53:44 2019] 0000000000000015 0000000000000000 ffff88046464f300 ffff880463138000
[pon sie 12 11:53:44 2019] Call Trace:
[pon sie 12 11:53:44 2019] [<ffffffff813ffc13>] dump_stack+0x63/0x90
[pon sie 12 11:53:44 2019] [<ffffffff8121012e>] dump_header+0x5a/0x1c5
[pon sie 12 11:53:44 2019] [<ffffffff81397c44>] ? apparmor_capable+0xc4/0x1b0
[pon sie 12 11:53:44 2019] [<ffffffff811968f2>] oom_kill_process+0x202/0x3c0
[pon sie 12 11:53:44 2019] [<ffffffff81196d19>] out_of_memory+0x219/0x460
[pon sie 12 11:53:44 2019] [<ffffffff8119cd45>] __alloc_pages_slowpath.constprop.88+0x965/0xb00
[pon sie 12 11:53:44 2019] [<ffffffff8119d168>] __alloc_pages_nodemask+0x288/0x2a0
[pon sie 12 11:53:44 2019] [<ffffffff811e84ed>] alloc_pages_vma+0xad/0x250
[pon sie 12 11:53:44 2019] [<ffffffff811d8ece>] __read_swap_cache_async+0xee/0x140
[pon sie 12 11:53:44 2019] [<ffffffff811d8f46>] read_swap_cache_async+0x26/0x60
[pon sie 12 11:53:44 2019] [<ffffffff811d9085>] swapin_readahead+0x105/0x1b0
[pon sie 12 11:53:44 2019] [<ffffffff811c60f0>] handle_mm_fault+0x1320/0x1820
[pon sie 12 11:53:44 2019] [<ffffffff810f340c>] ? hrtimer_nanosleep+0xdc/0x210
[pon sie 12 11:53:44 2019] [<ffffffff8106c747>] __do_page_fault+0x197/0x400
[pon sie 12 11:53:44 2019] [<ffffffff8106c9d2>] do_page_fault+0x22/0x30
[pon sie 12 11:53:44 2019] [<ffffffff818519d8>] page_fault+0x28/0x30
[pon sie 12 11:53:44 2019] Mem-Info:
[pon sie 12 11:53:44 2019] active_anon:3530449 inactive_anon:422028 isolated_anon:384
active_file:179 inactive_file:100 isolated_file:0
unevictable:913 dirty:0 writeback:0 unstable:0
slab_reclaimable:9555 slab_unreclaimable:17443
mapped:666425 shmem:1068600 pagetables:11052 bounce:0
free:35287 free_pcp:0 free_cma:0
[pon sie 12 11:53:44 2019] Node 0 DMA free:15888kB min:64kB low:80kB high:96kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15988kB managed:15888kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
[pon sie 12 11:53:44 2019] lowmem_reserve[]: 0 1811 15874 15874 15874
[pon sie 12 11:53:44 2019] Node 0 DMA32 free:63400kB min:7704kB low:9628kB high:11556kB active_anon:1349712kB inactive_anon:449972kB active_file:164kB inactive_file:172kB unevictable:904kB isolated(anon):768kB isolated(file):0kB present:1987100kB managed:1906332kB mlocked:904kB dirty:0kB writeback:0kB mapped:53540kB shmem:495788kB slab_reclaimable:3864kB slab_unreclaimable:7812kB kernel_stack:400kB pagetables:7000kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:11349276 all_unreclaimable? yes
[pon sie 12 11:53:44 2019] lowmem_reserve[]: 0 0 14062 14062 14062
[pon sie 12 11:53:44 2019] Node 0 Normal free:61860kB min:59812kB low:74764kB high:89716kB active_anon:12772084kB inactive_anon:1238140kB active_file:552kB inactive_file:228kB unevictable:2748kB isolated(anon):768kB isolated(file):0kB present:14663680kB managed:14400224kB mlocked:2748kB dirty:0kB writeback:0kB mapped:2612160kB shmem:3778612kB slab_reclaimable:34356kB slab_unreclaimable:61960kB kernel_stack:3952kB pagetables:37208kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:89423048 all_unreclaimable? yes
[pon sie 12 11:53:44 2019] lowmem_reserve[]: 0 0 0 0 0
[pon sie 12 11:53:44 2019] Node 0 DMA: 2*4kB (U) 3*8kB (U) 3*16kB (U) 0*32kB 3*64kB (U) 2*128kB (U) 0*256kB 0*512kB 1*1024kB (U) 1*2048kB (M) 3*4096kB (M) = 15888kB
[pon sie 12 11:53:44 2019] Node 0 DMA32: 147*4kB (UME) 54*8kB (UME) 458*16kB (UME) 139*32kB (UME) 106*64kB (UME) 51*128kB (UME) 23*256kB (UE) 17*512kB (UE) 3*1024kB (UME) 0*2048kB 5*4096kB (M) = 64252kB
[pon sie 12 11:53:44 2019] Node 0 Normal: 267*4kB (UME) 183*8kB (UME) 230*16kB (UMEH) 215*32kB (UMEH) 86*64kB (UEH) 86*128kB (UMEH) 70*256kB (UMEH) 26*512kB (UMEH) 1*1024kB (U) 0*2048kB 0*4096kB = 61860kB
[pon sie 12 11:53:44 2019] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
[pon sie 12 11:53:44 2019] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
[pon sie 12 11:53:44 2019] 1083770 total pagecache pages
[pon sie 12 11:53:44 2019] 14283 pages in swap cache
[pon sie 12 11:53:44 2019] Swap cache stats: add 81268022, delete 81253739, find 37239561/47307273
[pon sie 12 11:53:44 2019] Free swap = 14632936kB
[pon sie 12 11:53:44 2019] Total swap = 16662524kB
[pon sie 12 11:53:44 2019] 4166692 pages RAM
[pon sie 12 11:53:44 2019] 0 pages HighMem/MovableOnly
[pon sie 12 11:53:44 2019] 86081 pages reserved
[pon sie 12 11:53:44 2019] 0 pages cma reserved
[pon sie 12 11:53:44 2019] 0 pages hwpoisoned
[pon sie 12 11:53:44 2019] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds swapents oom_score_adj name
[pon sie 12 11:53:44 2019] [ 449] 0 449 42126 113 18 3 75 0 lvmetad
[pon sie 12 11:53:44 2019] [ 461] 0 461 11311 172 22 3 361 -1000 systemd-udevd
[pon sie 12 11:53:44 2019] [ 917] 0 917 151045 242 28 3 730 0 lxcfs
[pon sie 12 11:53:44 2019] [ 924] 0 924 7557 409 19 3 80 0 cron
[pon sie 12 11:53:44 2019] [ 929] 0 929 1099 288 7 3 36 0 acpid
[pon sie 12 11:53:44 2019] [ 944] 112 944 11227 404 25 3 117 0 avahi-daemon
[pon sie 12 11:53:44 2019] [ 946] 0 946 6511 375 18 3 77 0 atd
[pon sie 12 11:53:44 2019] [ 951] 0 951 6320 398 17 4 227 0 smartd
[pon sie 12 11:53:44 2019] [ 954] 104 954 64098 283 28 3 283 0 rsyslogd
[pon sie 12 11:53:44 2019] [ 956] 107 956 10792 329 25 3 191 -900 dbus-daemon
[pon sie 12 11:53:44 2019] [ 977] 112 977 11196 0 24 3 81 0 avahi-daemon
[pon sie 12 11:53:44 2019] [ 982] 0 982 112713 309 73 4 700 0 NetworkManager
[pon sie 12 11:53:44 2019] [ 983] 0 983 8863 347 20 3 241 0 openvpn
[pon sie 12 11:53:44 2019] [ 986] 0 986 69321 328 37 3 234 0 accounts-daemon
[pon sie 12 11:53:44 2019] [ 1002] 0 1002 3343 226 11 3 41 0 mdadm
[pon sie 12 11:53:44 2019] [ 1011] 0 1011 69277 371 39 4 188 0 polkitd
[pon sie 12 11:53:44 2019] [ 1087] 0 1087 4030 321 13 3 215 0 dhclient
[pon sie 12 11:53:44 2019] [ 1275] 0 1275 16377 341 37 3 185 -1000 sshd
[pon sie 12 11:53:44 2019] [ 1284] 0 1284 211630 0 86 6 9081 -500 dockerd
[pon sie 12 11:53:44 2019] [ 1306] 0 1306 1305 405 9 3 51 0 iscsid
[pon sie 12 11:53:44 2019] [ 1310] 0 1310 1430 876 9 3 0 -17 iscsid
[pon sie 12 11:53:44 2019] [ 1409] 0 1409 4868 367 14 3 73 0 irqbalance
[pon sie 12 11:53:44 2019] [ 1418] 0 1418 4289 313 14 3 39 0 agetty
[pon sie 12 11:53:44 2019] [ 1457] 0 1457 168379 0 65 6 5264 -500 docker-containe
[pon sie 12 11:53:44 2019] [ 2193] 0 2193 10705 145 14 5 154 -500 docker-proxy
[pon sie 12 11:53:44 2019] [ 2229] 0 2229 66420 186 21 5 660 -500 docker-proxy
[pon sie 12 11:53:44 2019] [ 2264] 0 2264 29138 123 16 5 167 -500 docker-proxy
[pon sie 12 11:53:44 2019] [ 2299] 0 2299 1876 0 8 5 347 -999 docker-containe
[pon sie 12 11:53:44 2019] [ 2391] 100 2391 396 0 7 3 29 0 entrypoint.sh
[pon sie 12 11:53:44 2019] [ 2638] 100 2638 12125 0 30 3 7058 0 tor
[pon sie 12 11:53:44 2019] [30130] 0 30130 7160 153 20 3 89 0 systemd-logind
[pon sie 12 11:53:44 2019] [30475] 0 30475 10959 278 23 3 1630 0 systemd-journal
[pon sie 12 11:53:44 2019] [31698] 1001 31698 11319 336 25 3 216 0 systemd
[pon sie 12 11:53:44 2019] [31701] 1001 31701 53717 0 39 3 1509 0 (sd-pam)
[pon sie 12 11:53:44 2019] [31955] 100 31955 24023 294 17 3 72 0 systemd-timesyn
[pon sie 12 11:53:44 2019] [31981] 0 31981 23731 413 49 4 236 0 sshd
[pon sie 12 11:53:44 2019] [32013] 1001 32013 23731 266 48 4 259 0 sshd
[pon sie 12 11:53:44 2019] [32014] 1001 32014 6235 500 17 3 599 0 bash
[pon sie 12 11:53:44 2019] [32194] 0 32194 23731 419 49 3 236 0 sshd
[pon sie 12 11:53:44 2019] [32287] 1001 32287 23788 197 48 3 244 0 sshd
[pon sie 12 11:53:44 2019] [32288] 1001 32288 6229 420 17 3 659 0 bash
[pon sie 12 11:53:44 2019] [32738] 1001 32738 11646105 3547862 9767 28 454793 0 training.py
[pon sie 12 11:53:44 2019] [32754] 0 32754 4286 267 14 3 45 0 nvidia-persiste
[pon sie 12 11:53:44 2019] [ 343] 0 343 23731 437 51 3 236 0 sshd
[pon sie 12 11:53:44 2019] [ 445] 1001 445 23731 101 49 3 206 0 sshd
[pon sie 12 11:53:44 2019] [ 451] 1001 451 6188 480 17 3 514 0 bash
[pon sie 12 11:53:44 2019] [ 473] 1001 473 6847 408 18 3 2 0 htop
[pon sie 12 11:53:44 2019] Out of memory: Kill process 32738 (training.py) score 486 or sacrifice child
[pon sie 12 11:53:44 2019] Killed process 32738 (training.py) total-vm:46584420kB, anon-rss:11534960kB, file-rss:2656488kB
为什么不使用剩余的 SWAP?