The patch titled Subject: proc, oom: do not report alien mms when setting oom_score_adj has been added to the -mm tree. Its filename is proc-oom-do-not-report-alien-mms-when-setting-oom_score_adj.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/proc-oom-do-not-report-alien-mms-when-setting-oom_score_adj.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/proc-oom-do-not-report-alien-mms-when-setting-oom_score_adj.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Michal Hocko <mhocko@xxxxxxxx> Subject: proc, oom: do not report alien mms when setting oom_score_adj Tetsuo has reported that creating a thousands of processes sharing MM without SIGHAND (aka alien threads) and setting /proc/<pid>/oom_score_adj will swamp the kernel log and takes ages [1] to finish. This is especially worrisome that all that printing is done under RCU lock and this can potentially trigger RCU stall or softlockup detector. The primary reason for the printk was to catch potential users who might depend on the behavior prior to 44a70adec910 ("mm, oom_adj: make sure processes sharing mm have same view of oom_score_adj") but after more than 2 years without a single report I guess it is safe to simply remove the printk altogether. The next step should be moving oom_score_adj over to the mm struct and remove all the tasks crawling as suggested by [2] [1] http://lkml.kernel.org/r/97fce864-6f75-bca5-14bc-12c9f890e740@xxxxxxxxxxxxxxxxxxx [2] http://lkml.kernel.org/r/20190117155159.GA4087@xxxxxxxxxxxxxx Link: http://lkml.kernel.org/r/20190212102129.26288-1-mhocko@xxxxxxxxxx Signed-off-by: Michal Hocko <mhocko@xxxxxxxx> Reported-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Yong-Taek Lee <ytk.lee@xxxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/proc/base.c | 4 ---- 1 file changed, 4 deletions(-) --- a/fs/proc/base.c~proc-oom-do-not-report-alien-mms-when-setting-oom_score_adj +++ a/fs/proc/base.c @@ -1086,10 +1086,6 @@ static int __set_oom_adj(struct file *fi task_lock(p); if (!p->vfork_done && process_shares_mm(p, mm)) { - pr_info("updating oom_score_adj for %d (%s) from %d to %d because it shares mm with %d (%s). Report if this is unexpected.\n", - task_pid_nr(p), p->comm, - p->signal->oom_score_adj, oom_adj, - task_pid_nr(task), task->comm); p->signal->oom_score_adj = oom_adj; if (!legacy && has_capability_noaudit(current, CAP_SYS_RESOURCE)) p->signal->oom_score_adj_min = (short)oom_adj; _ Patches currently in -mm which might be from mhocko@xxxxxxxx are proc-oom-do-not-report-alien-mms-when-setting-oom_score_adj.patch