In the Linux kernel, the following vulnerability has been resolved:
mm/swapfile: add condresched() in getswap_pages()
The softlockup still occurs in getswappages() under memory pressure. 64 CPU cores, 64GB memory, and 28 zram devices, the disksize of each zram device is 50MB with same priority as si. Use the stress-ng tool to increase memory pressure, causing the system to oom frequently.
The plistforeachentrysafe() loops in getswappages() could reach tens of thousands of times to find available space (extreme case: condresched() is not called in scanswapmapslots()). Let's add condresched() into getswap_pages() when failed to find available space to avoid softlockup.