On 2019/07/24 8:14, Andrew Morton wrote: > On Wed, 17 Jul 2019 19:55:01 +0900 Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> wrote: > >> Currently dump_tasks() might call printk() for many thousands times under >> RCU, which might take many minutes for slow consoles. Therefore, split >> dump_tasks() into three stages; take a snapshot of possible OOM victim >> candidates under RCU, dump the snapshot from reschedulable context, and >> destroy the snapshot. >> >> In a future patch, the first stage would be moved to select_bad_process() >> and the third stage would be moved to after oom_kill_process(), and will >> simplify refcount handling. > > Look straightforward enough. Thanks. > >> >> ... >> >> static void dump_tasks(struct oom_control *oc) >> { >> - pr_info("Tasks state (memory values in pages):\n"); >> - pr_info("[ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name\n"); >> + static LIST_HEAD(list); > > I don't think this needs to be static? Well, the OOM killer is serialized by oom_lock mutex. Thus, I guess we should reduce stack usage where reasonable. For now you can drop this "static" if you want. But this variable will be after all moved to outside of this function by a future patch... > >> + struct task_struct *p; >> + struct task_struct *t; >>