bisecting cause commit starting from d31958b30ea3b7b6e522d6bf449427748ad45822 building syzkaller on 18d18b591b354e07ba76be8f115b7119d49056a9 testing commit d31958b30ea3b7b6e522d6bf449427748ad45822 with gcc (GCC) 8.1.0 kernel signature: d48297b8cbc190bdd6afd0a9030e5c7d1192ebb3c94d8bd66f36c754bc00e323 all runs: crashed: kernel panic: System is deadlocked on memory testing release v5.7 testing commit 3d77e6a8804abcc0504c904bd6e5cdf3a5cf8162 with gcc (GCC) 8.1.0 kernel signature: 454a7bf78d496d3967442d62722956f14abcab0017db718ddfe6477ef4363956 all runs: OK # git bisect start d31958b30ea3b7b6e522d6bf449427748ad45822 3d77e6a8804abcc0504c904bd6e5cdf3a5cf8162 Bisecting: 11951 revisions left to test after this (roughly 14 steps) [081096d98bb23946f16215357b141c5616b234bf] Merge tag 'tty-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty testing commit 081096d98bb23946f16215357b141c5616b234bf with gcc (GCC) 8.1.0 kernel signature: 431193f620a44622978c421cae1fe6cc1e9045791acbdca2fb35f3b9dd42b72f all runs: basic kernel testing failed: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks # git bisect skip 081096d98bb23946f16215357b141c5616b234bf Bisecting: 11951 revisions left to test after this (roughly 14 steps) [3700bec3323ebe90924156775be0124e93094f78] docs: filesystems: convert gfs2-glocks.txt to ReST testing commit 3700bec3323ebe90924156775be0124e93094f78 with gcc (GCC) 8.1.0 kernel signature: 3a65cc6b83b43c6508759f645e59a94d3f16967f90e73dab56fa474a6296347d all runs: OK # git bisect good 3700bec3323ebe90924156775be0124e93094f78 Bisecting: 11950 revisions left to test after this (roughly 14 steps) [a9ec8423134a54c9f0ae8d4ef59e1e833ca917c2] Bluetooth: Allow suspend even when preparation has failed testing commit a9ec8423134a54c9f0ae8d4ef59e1e833ca917c2 with gcc (GCC) 8.1.0 kernel signature: 05384b11ef2121261977cee9a8fdacdeae9f7e26a87f0fb96fd295fac1bc00df all runs: OK # git bisect good a9ec8423134a54c9f0ae8d4ef59e1e833ca917c2 Bisecting: 10392 revisions left to test after this (roughly 13 steps) [1bcdc68d6a69440ff82c3e492cd383059852bdd7] m68k/mm: move {cache,nocahe}_page() definitions close to their user testing commit 1bcdc68d6a69440ff82c3e492cd383059852bdd7 with gcc (GCC) 8.1.0 kernel signature: 3544f7675116181fe8b1c313644111a2db34649a43411a17ba0e7d4a994f4e4e all runs: basic kernel testing failed: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks # git bisect skip 1bcdc68d6a69440ff82c3e492cd383059852bdd7 Bisecting: 10392 revisions left to test after this (roughly 13 steps) [935da5e5100f57d843cac4781b21f1c235059aa0] mtd: spi-nor: cadence-quadspi: Handle probe deferral while requesting DMA channel testing commit 935da5e5100f57d843cac4781b21f1c235059aa0 with gcc (GCC) 8.1.0 kernel signature: 1320fc90ed0931372bca00ef6b911aa4f5465fe1905e036021720ed1735514ed all runs: basic kernel testing failed: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks # git bisect skip 935da5e5100f57d843cac4781b21f1c235059aa0 Bisecting: 10392 revisions left to test after this (roughly 13 steps) [dc3d8f85bb571c3640ebba24b82a527cf2cb3f24] powerpc/powernv/pci: Re-work bus PE configuration testing commit dc3d8f85bb571c3640ebba24b82a527cf2cb3f24 with gcc (GCC) 8.1.0 kernel signature: f2f8946326e194c0641c224ebd930f95b5845fa1491ac4735e343854a2d2e701 all runs: OK # git bisect good dc3d8f85bb571c3640ebba24b82a527cf2cb3f24 Bisecting: 10288 revisions left to test after this (roughly 13 steps) [ad57a1022f9e050a09812d975874b94b4fcb0f46] Merge tag 'exfat-for-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat testing commit ad57a1022f9e050a09812d975874b94b4fcb0f46 with gcc (GCC) 8.1.0 kernel signature: 807ccb2e835fca77d8145bfa7f27701603ea5a5ad455f52c3ddb72420e73402a all runs: basic kernel testing failed: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks # git bisect skip ad57a1022f9e050a09812d975874b94b4fcb0f46 Bisecting: 10288 revisions left to test after this (roughly 13 steps) [b23c4771ff62de8ca9b5e4a2d64491b2fb6f8f69] Merge tag 'docs-5.8' of git://git.lwn.net/linux testing commit b23c4771ff62de8ca9b5e4a2d64491b2fb6f8f69 with gcc (GCC) 8.1.0 kernel signature: 79149b1f05142b35f7f68f7049876eb81fc283214bf67012dcca611442732b66 all runs: OK # git bisect good b23c4771ff62de8ca9b5e4a2d64491b2fb6f8f69 Bisecting: 9664 revisions left to test after this (roughly 13 steps) [84fc461db99b2dc19e019c0a97725a3653687981] Merge tag 'for-linus-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml testing commit 84fc461db99b2dc19e019c0a97725a3653687981 with gcc (GCC) 8.1.0 kernel signature: 8c8a50c5c85e04de8051c722617a46d12409368468e397e2d792f84e4e0d46d8 all runs: basic kernel testing failed: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks # git bisect skip 84fc461db99b2dc19e019c0a97725a3653687981 Bisecting: 9664 revisions left to test after this (roughly 13 steps) [e6f1eb4cbf53269cdab8dd4ae1ad2bba384e6ca6] drm/amd/powerplay: maximize code sharing between .hw_fini and .suspend testing commit e6f1eb4cbf53269cdab8dd4ae1ad2bba384e6ca6 with gcc (GCC) 8.1.0 kernel signature: fca700623287a30fe5ab67ba4e90b3530aaf1b99cc315b825ee0daf1ee3efb02 all runs: OK # git bisect good e6f1eb4cbf53269cdab8dd4ae1ad2bba384e6ca6 Bisecting: 8781 revisions left to test after this (roughly 13 steps) [52cd0d972fa6491928add05f11f97a4a59babe92] Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm testing commit 52cd0d972fa6491928add05f11f97a4a59babe92 with gcc (GCC) 8.1.0 kernel signature: cb304f271b9df4585c611d75a28275989e47e905c75eb574665f7bf3045df2b3 all runs: basic kernel testing failed: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks # git bisect skip 52cd0d972fa6491928add05f11f97a4a59babe92 Bisecting: 8781 revisions left to test after this (roughly 13 steps) [c7582ff7ed388b803d083166514a4c8acd4ef57d] platform/x86: intel_cht_int33fe: Fix spelling issues testing commit c7582ff7ed388b803d083166514a4c8acd4ef57d with gcc (GCC) 8.1.0 kernel signature: 2eac26465bef73604b8f2d270724875009d0ef534366e0f11ae83c61efe2ddda all runs: OK # git bisect good c7582ff7ed388b803d083166514a4c8acd4ef57d Bisecting: 8779 revisions left to test after this (roughly 13 steps) [7de26c41c19fc7b2e078d31fd039e1a017064b89] Merge tag 'nios2-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2 testing commit 7de26c41c19fc7b2e078d31fd039e1a017064b89 with gcc (GCC) 8.1.0 kernel signature: 0f5d45f871e0ee6c54b63729a19fc9193958600eedf1a180be472b86dee559dc all runs: basic kernel testing failed: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks # git bisect skip 7de26c41c19fc7b2e078d31fd039e1a017064b89 Bisecting: 8779 revisions left to test after this (roughly 13 steps) [89d1f0966997d5bbe510dbdb10a5c26c0e567b03] net: enetc: add support max frame size for tc flower offload testing commit 89d1f0966997d5bbe510dbdb10a5c26c0e567b03 with gcc (GCC) 8.1.0 kernel signature: cbb8f38b741107e2a594b5c08fd1b961c24535519eb4aec4a2f1ff2930e60a0e all runs: basic kernel testing failed: KASAN: use-after-free Write in afs_wake_up_async_call # git bisect skip 89d1f0966997d5bbe510dbdb10a5c26c0e567b03 Bisecting: 8779 revisions left to test after this (roughly 13 steps) [9a0f1341df7d555eb50a826d1f6f4191a78eabea] pinctrl: ingenic: Add irq_{request,release}_resources callbacks testing commit 9a0f1341df7d555eb50a826d1f6f4191a78eabea with gcc (GCC) 8.1.0 kernel signature: 0fe03b3d51b5ea7a0c840cd129e4656bdede1febe22db284aad12a15abb97a8a all runs: OK # git bisect good 9a0f1341df7d555eb50a826d1f6f4191a78eabea Bisecting: 8763 revisions left to test after this (roughly 13 steps) [bba18a1af33e0f0a1ad7d028208b306ef3f3df12] console: Propagate error code from console ->setup() testing commit bba18a1af33e0f0a1ad7d028208b306ef3f3df12 with gcc (GCC) 8.1.0 kernel signature: 81b345a096ce93adc114d40060705f6f308b55c87767c7a344ee79da83cb0caa all runs: basic kernel testing failed: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks # git bisect skip bba18a1af33e0f0a1ad7d028208b306ef3f3df12 Bisecting: 8763 revisions left to test after this (roughly 13 steps) [fd7af71be54271a9f03b2e6f63e4b3ac1ecd113d] kexec: do not verify the signature without the lockdown or mandatory signature testing commit fd7af71be54271a9f03b2e6f63e4b3ac1ecd113d with gcc (GCC) 8.1.0 kernel signature: 4885d77a225db41885f3e4334f43444604e74f3fd73341afe6b962aeb26cb2a9 all runs: basic kernel testing failed: KASAN: use-after-free Write in afs_wake_up_async_call # git bisect skip fd7af71be54271a9f03b2e6f63e4b3ac1ecd113d Bisecting: 8763 revisions left to test after this (roughly 13 steps) [0475bd6c65976c390e3805a1e5f10fc30ca8def2] scsi: merge scsi_init_sgtable into scsi_init_io testing commit 0475bd6c65976c390e3805a1e5f10fc30ca8def2 with gcc (GCC) 8.1.0 kernel signature: f011f27ce0751f6ebf1031ed425d69d962057f5f151c12637919aca476ee2546 all runs: OK # git bisect good 0475bd6c65976c390e3805a1e5f10fc30ca8def2 Bisecting: 8754 revisions left to test after this (roughly 13 steps) [1411ed3d694c330221271fad0b92aadf5cb42aef] Merge branch 'for-5.9-console-return-codes' into for-next testing commit 1411ed3d694c330221271fad0b92aadf5cb42aef with gcc (GCC) 8.1.0 kernel signature: 64dc125fe688eb0cbe2e71447db34e04678e71006e68fbb3a6396bdd581c8a7c all runs: basic kernel testing failed: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks # git bisect skip 1411ed3d694c330221271fad0b92aadf5cb42aef Bisecting: 8754 revisions left to test after this (roughly 13 steps) [6d6c5e56d7718cdb7903d8ad2a1048fbe92afba6] iio: accel: dmard06: Use mod_devicetable.h and drop of_match_ptr macro testing commit 6d6c5e56d7718cdb7903d8ad2a1048fbe92afba6 with gcc (GCC) 8.1.0 kernel signature: e385a3ffde912b9c8be9057032e623b2e780200f19633a380b17fb634781c235 all runs: OK # git bisect good 6d6c5e56d7718cdb7903d8ad2a1048fbe92afba6 Bisecting: 8542 revisions left to test after this (roughly 13 steps) [076f14be7fc942e112c94c841baec44124275cd0] Merge tag 'x86-entry-2020-06-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip testing commit 076f14be7fc942e112c94c841baec44124275cd0 with gcc (GCC) 8.1.0 kernel signature: 87f674f8acafe8a1e4ad9b68d551afbd66a12640149e5dcefd52c87f32d00ee0 all runs: basic kernel testing failed: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks # git bisect skip 076f14be7fc942e112c94c841baec44124275cd0 Bisecting: 8542 revisions left to test after this (roughly 13 steps) [7a24392c80606dfb0396a75e45e0b757c831f49a] scftorture: Make symbol 'scf_torture_rand' static testing commit 7a24392c80606dfb0396a75e45e0b757c831f49a with gcc (GCC) 8.1.0 kernel signature: d0d9d59d46b4121133bdb3a23bc246e368dd2263ad34153caf193da616aeeab0 all runs: OK # git bisect good 7a24392c80606dfb0396a75e45e0b757c831f49a Bisecting: 3493 revisions left to test after this (roughly 12 steps) [9293d978795baf0bf26ee58ff9f7e7abba2c738d] Merge remote-tracking branch 'spi-nor/spi-nor/next' testing commit 9293d978795baf0bf26ee58ff9f7e7abba2c738d with gcc (GCC) 8.1.0 kernel signature: 3342aa3b7ae180fb037acd82352ace6bcc705ab67f4db038047f02155ce6d6ab all runs: OK # git bisect good 9293d978795baf0bf26ee58ff9f7e7abba2c738d Bisecting: 1752 revisions left to test after this (roughly 11 steps) [a1170b9fab2c0faba9b833866dd068675fcb0117] Merge remote-tracking branch 'selinux/next' testing commit a1170b9fab2c0faba9b833866dd068675fcb0117 with gcc (GCC) 8.1.0 kernel signature: 3de81ca86080cce382830e1ec75d5bd2b44063e02a83f6ffec0a8004e34fefde all runs: OK # git bisect good a1170b9fab2c0faba9b833866dd068675fcb0117 Bisecting: 883 revisions left to test after this (roughly 10 steps) [49833e43a669c8807b1d636f866bd24ec1b1e12c] Merge remote-tracking branch 'dmaengine/next' testing commit 49833e43a669c8807b1d636f866bd24ec1b1e12c with gcc (GCC) 8.1.0 kernel signature: 576aff6be41f5f60ca0ead4141e4250ba0778bb1c0708869539fc56d1a539e22 all runs: OK # git bisect good 49833e43a669c8807b1d636f866bd24ec1b1e12c Bisecting: 436 revisions left to test after this (roughly 9 steps) [479c9a8d930f32ea56e1e03ae689d1150e64a2c8] Merge remote-tracking branch 'fsi/next' testing commit 479c9a8d930f32ea56e1e03ae689d1150e64a2c8 with gcc (GCC) 8.1.0 kernel signature: 31b2b9d54905cff66755b86cfbec4ccd7babfc9e4cfe0fcb71edd6efe62a7c14 all runs: OK # git bisect good 479c9a8d930f32ea56e1e03ae689d1150e64a2c8 Bisecting: 218 revisions left to test after this (roughly 8 steps) [6cff7b037d3df720d576c6c2d08d12456381352d] fs/buffer.c: add debug print for __getblk_gfp() stall problem testing commit 6cff7b037d3df720d576c6c2d08d12456381352d with gcc (GCC) 8.1.0 kernel signature: 71ed4544f9be6b94b4e8ba3edd0517b2a217ead9732c5ee699c20dc3c019b933 all runs: crashed: kernel panic: System is deadlocked on memory # git bisect bad 6cff7b037d3df720d576c6c2d08d12456381352d Bisecting: 108 revisions left to test after this (roughly 7 steps) [c7f0a899b044f60cb63c68330996a4e836c7ad42] mm/mmap: optimize a branch judgment in ksys_mmap_pgoff() testing commit c7f0a899b044f60cb63c68330996a4e836c7ad42 with gcc (GCC) 8.1.0 kernel signature: 83cb002d01a01cb7c6a862d4c474df7cc3fa19ddc4629cec95b59d330eb62678 all runs: OK # git bisect good c7f0a899b044f60cb63c68330996a4e836c7ad42 Bisecting: 54 revisions left to test after this (roughly 6 steps) [1a1858be117454c6939a64fb4345002c50e164c3] mm/page_alloc: keep memoryless cpuless node 0 offline testing commit 1a1858be117454c6939a64fb4345002c50e164c3 with gcc (GCC) 8.1.0 kernel signature: b4fcb8f719f7b44527ac07815add4d5c22519fe8c2d92f9bcbfe922e311f2f7e all runs: OK # git bisect good 1a1858be117454c6939a64fb4345002c50e164c3 Bisecting: 27 revisions left to test after this (roughly 5 steps) [02fed10c3a4f0ab0adeab80767e602e006380b7e] mm: introduce offset_in_thp testing commit 02fed10c3a4f0ab0adeab80767e602e006380b7e with gcc (GCC) 8.1.0 kernel signature: 1cd8923a8e62296865befaeda937c93994324d6f552a7dc7d673c0bbfc02e505 all runs: crashed: kernel panic: System is deadlocked on memory # git bisect bad 02fed10c3a4f0ab0adeab80767e602e006380b7e Bisecting: 13 revisions left to test after this (roughly 4 steps) [895186ca677b8a8cdb164450dab5e0e89fc49cff] mm: use unsigned types for fragmentation score testing commit 895186ca677b8a8cdb164450dab5e0e89fc49cff with gcc (GCC) 8.1.0 kernel signature: 90b64a1d69f787c06250d9bbbcef2ef5f43e59256f98d785a30c85df021b73f8 run #0: boot failed: can't ssh into the instance run #1: OK run #2: OK run #3: OK run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK # git bisect good 895186ca677b8a8cdb164450dab5e0e89fc49cff Bisecting: 6 revisions left to test after this (roughly 3 steps) [ef1219330bcea4895acd86b942747a0ac8c83f64] mm: thp: remove debug_cow switch testing commit ef1219330bcea4895acd86b942747a0ac8c83f64 with gcc (GCC) 8.1.0 kernel signature: 6c93eed532f5a8e7daa1a1478c245736bbcf89c9353acfb4367d30465071eade run #0: crashed: kernel panic: System is deadlocked on memory run #1: crashed: kernel panic: System is deadlocked on memory run #2: crashed: kernel panic: System is deadlocked on memory run #3: crashed: kernel panic: System is deadlocked on memory run #4: crashed: kernel panic: System is deadlocked on memory run #5: crashed: kernel panic: System is deadlocked on memory run #6: crashed: kernel panic: System is deadlocked on memory run #7: crashed: kernel panic: System is deadlocked on memory run #8: crashed: kernel panic: System is deadlocked on memory run #9: boot failed: can't ssh into the instance # git bisect bad ef1219330bcea4895acd86b942747a0ac8c83f64 Bisecting: 3 revisions left to test after this (roughly 2 steps) [06dde99d771aa2b936b91d65a44b012a17e76e9c] doc, mm: clarify /proc//oom_score value range testing commit 06dde99d771aa2b936b91d65a44b012a17e76e9c with gcc (GCC) 8.1.0 kernel signature: 6e768a97238a0e9d1dca4046e87d6fc4b01d8d2d48e37ee0fcdb34104207732d all runs: crashed: kernel panic: System is deadlocked on memory # git bisect bad 06dde99d771aa2b936b91d65a44b012a17e76e9c Bisecting: 1 revision left to test after this (roughly 1 step) [e642d9be463d02c735cd99a9a904063324ee03d6] mm, oom: make the calculation of oom badness more accurate testing commit e642d9be463d02c735cd99a9a904063324ee03d6 with gcc (GCC) 8.1.0 kernel signature: 7ce07823b276b3161ca8436fa68b4efe4276cd4b1cc1e618905e2da970a05b86 all runs: crashed: kernel panic: System is deadlocked on memory # git bisect bad e642d9be463d02c735cd99a9a904063324ee03d6 e642d9be463d02c735cd99a9a904063324ee03d6 is the first bad commit commit e642d9be463d02c735cd99a9a904063324ee03d6 Author: Yafang Shao Date: Fri Jul 10 14:58:08 2020 +1000 mm, oom: make the calculation of oom badness more accurate Recently we found an issue on our production environment that when memcg oom is triggered the oom killer doesn't chose the process with largest resident memory but chose the first scanned process. Note that all processes in this memcg have the same oom_score_adj, so the oom killer should chose the process with largest resident memory. Bellow is part of the oom info, which is enough to analyze this issue. [7516987.983223] memory: usage 16777216kB, limit 16777216kB, failcnt 52843037 [7516987.983224] memory+swap: usage 16777216kB, limit 9007199254740988kB, failcnt 0 [7516987.983225] kmem: usage 301464kB, limit 9007199254740988kB, failcnt 0 [...] [7516987.983293] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name [7516987.983510] [ 5740] 0 5740 257 1 32768 0 -998 pause [7516987.983574] [58804] 0 58804 4594 771 81920 0 -998 entry_point.bas [7516987.983577] [58908] 0 58908 7089 689 98304 0 -998 cron [7516987.983580] [58910] 0 58910 16235 5576 163840 0 -998 supervisord [7516987.983590] [59620] 0 59620 18074 1395 188416 0 -998 sshd [7516987.983594] [59622] 0 59622 18680 6679 188416 0 -998 python [7516987.983598] [59624] 0 59624 1859266 5161 548864 0 -998 odin-agent [7516987.983600] [59625] 0 59625 707223 9248 983040 0 -998 filebeat [7516987.983604] [59627] 0 59627 416433 64239 774144 0 -998 odin-log-agent [7516987.983607] [59631] 0 59631 180671 15012 385024 0 -998 python3 [7516987.983612] [61396] 0 61396 791287 3189 352256 0 -998 client [7516987.983615] [61641] 0 61641 1844642 29089 946176 0 -998 client [7516987.983765] [ 9236] 0 9236 2642 467 53248 0 -998 php_scanner [7516987.983911] [42898] 0 42898 15543 838 167936 0 -998 su [7516987.983915] [42900] 1000 42900 3673 867 77824 0 -998 exec_script_vr2 [7516987.983918] [42925] 1000 42925 36475 19033 335872 0 -998 python [7516987.983921] [57146] 1000 57146 3673 848 73728 0 -998 exec_script_J2p [7516987.983925] [57195] 1000 57195 186359 22958 491520 0 -998 python2 [7516987.983928] [58376] 1000 58376 275764 14402 290816 0 -998 rosmaster [7516987.983931] [58395] 1000 58395 155166 4449 245760 0 -998 rosout [7516987.983935] [58406] 1000 58406 18285584 3967322 37101568 0 -998 data_sim [7516987.984221] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=3aa16c9482ae3a6f6b78bda68a55d32c87c99b985e0f11331cddf05af6c4d753,mems_allowed=0-1,oom_memcg=/kubepods/podf1c273d3-9b36-11ea-b3df-246e9693c184,task_memcg=/kubepods/podf1c273d3-9b36-11ea-b3df-246e9693c184/1f246a3eeea8f70bf91141eeaf1805346a666e225f823906485ea0b6c37dfc3d,task=pause,pid=5740,uid=0 [7516987.984254] Memory cgroup out of memory: Killed process 5740 (pause) total-vm:1028kB, anon-rss:4kB, file-rss:0kB, shmem-rss:0kB [7516988.092344] oom_reaper: reaped process 5740 (pause), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB We can find that the first scanned process 5740 (pause) was killed, but its rss is only one page. That is because, when we calculate the oom badness in oom_badness(), we always ignore the negtive point and convert all of these negtive points to 1. Now as oom_score_adj of all the processes in this targeted memcg have the same value -998, the points of these processes are all negtive value. As a result, the first scanned process will be killed. The oom_socre_adj (-998) in this memcg is set by kubelet, because it is a a Guaranteed pod, which has higher priority to prevent from being killed by system oom. To fix this issue, we should make the calculation of oom point more accurate. We can achieve it by convert the chosen_point from 'unsigned long' to 'long'. Link: http://lkml.kernel.org/r/1594309987-9919-1-git-send-email-laoar.shao@gmail.com Signed-off-by: Yafang Shao Cc: Michal Hocko Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Stephen Rothwell drivers/tty/sysrq.c | 1 + fs/proc/base.c | 7 ++++++- include/linux/oom.h | 4 ++-- mm/memcontrol.c | 1 + mm/oom_kill.c | 19 ++++++++----------- mm/page_alloc.c | 1 + 6 files changed, 19 insertions(+), 14 deletions(-) culprit signature: 7ce07823b276b3161ca8436fa68b4efe4276cd4b1cc1e618905e2da970a05b86 parent signature: 90b64a1d69f787c06250d9bbbcef2ef5f43e59256f98d785a30c85df021b73f8 revisions tested: 36, total time: 7h40m33.668957538s (build: 3h18m6.837449151s, test: 4h16m42.08487769s) first bad commit: e642d9be463d02c735cd99a9a904063324ee03d6 mm, oom: make the calculation of oom badness more accurate cc: ["akpm@linux-foundation.org" "laoar.shao@gmail.com" "sfr@canb.auug.org.au"] crash: kernel panic: System is deadlocked on memory Out of memory and no killable processes... Kernel panic - not syncing: System is deadlocked on memory CPU: 0 PID: 8387 Comm: syz-executor.3 Not tainted 5.8.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xb3/0xec lib/dump_stack.c:118 panic+0x115/0x2fa kernel/panic.c:231 out_of_memory.cold.39+0x2f/0x85 mm/oom_kill.c:1106 pagefault_out_of_memory+0x6e/0x81 mm/oom_kill.c:1135 do_user_addr_fault arch/x86/mm/fault.c:1317 [inline] handle_page_fault arch/x86/mm/fault.c:1351 [inline] exc_page_fault+0x671/0x700 arch/x86/mm/fault.c:1404 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:544 RIP: 0033:0x40b57d Code: Bad RIP value. RSP: 002b:00007ff2cee42070 EFLAGS: 00010202 RAX: 000000000040b570 RBX: 000000000050b040 RCX: 0000000000000000 RDX: 0000000020fe8000 RSI: ffffffffffffffff RDI: ffffffffffffffff RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000064 R11: 0000000000000000 R12: 0000000000000003 R13: 0000000000000c4d R14: 00000000004ce8d2 R15: 00007ff2cee446d4 Kernel Offset: disabled Rebooting in 86400 seconds..