On 2025/1/4 0:18, Michal Koutný wrote: > Hello. > > On Tue, Dec 24, 2024 at 02:52:38AM +0000, Chen Ridong <chenridong@xxxxxxxxxxxxxxx> wrote: >> A soft lockup issue was found in the product with about 56,000 tasks were >> in the OOM cgroup, it was traversing them when the soft lockup was >> triggered. > > Why is this softlockup a problem? > It's lot of tasks afterall and possibly a slow console (given looking > for a victim among the comparable number didn't trigger it). > It's not a slow console, but rather 'console pressure'. When a lot of tasks apply to the console, it can make 'pr_info' slow. In my case, these tasks will apply to the console. I reproduced this issue using a test ko that creates many tasks, all of which just call 'pr_info'. Best regards, Ridong >> To fix this issue, call 'cond_resched' in the 'mem_cgroup_scan_tasks' >> function per 1000 iterations. For global OOM, call >> 'touch_softlockup_watchdog' per 1000 iterations to avoid this issue. > > This only hides the issue. It could be similarly fixed by simply > decreasing loglevel= ;-) > > cond_resched() in the memcg case may be OK but the arbitrary touch for > global situation may hide possibly useful troubleshooting information. > (Yeah, cond_resched() won't fit inside RCU section as in other global > task iterations.) > > 0.02€, > Michal