On 2020/07/14 11:13, Yafang Shao wrote: > But it seems the proposal that using trylock in > mem_cgroup_out_of_memory() should be better? > The trylock could also solve the problem that different processes are > doing oom at the same time. I think trylock is worse. The trylock needlessly wastes CPU time which could have been utilized by the OOM killer/reaper for reclaiming memory. If concurrent OOM on multiple non-overwrapping memcg domains is a real problem, killable lock on per-memcg oom_lock will be better than trylock on global oom_lock.