Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3652876imj; Tue, 12 Feb 2019 02:22:10 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia5FVr2YaUfwT75LCsWqVhw/oyttktLmoEpVwEWmk+ihjnJG6OlhMAaEbca6J51PW2NVAw0 X-Received: by 2002:a65:628e:: with SMTP id f14mr2934348pgv.193.1549966930879; Tue, 12 Feb 2019 02:22:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549966930; cv=none; d=google.com; s=arc-20160816; b=K8CocsudMWoWf8NrPA+zACmWYULNkFpHrSXfZknnQDhKPNj7UXcpAzGrYUi4gTbFl6 OAS96Atr/8dJ9+USfkvS9V80v6Y3BFVnuhRQE/q+0IfqEeJTsocfBiTNYKZOuu7UTNak vEIS5lrkD4V3/RlzDaaJmUQqocWSwIpUJLmBaKN/v3g8TAhhM0toPpZ9VJ647x66FX2Z KPKY6kQMVc6AIgMU0x3oM14zCDC6RtdSREk4AHRtfF6YNKkBM3v86P+pafhI2YRh1O0Y DcO70ryXP5k7VMNoUh49N2fQXXvqc18We2N1j1fZ/10wJuRJAKfPEFG21hfXRrtR4r+q SUuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Zo9+FKt51sWjrcVWjLOayf+02nh5kJtN90CHM7zOA8o=; b=M6O/FKyBRBb6t6D0Z4w5yNmarE5hqsSBhW7D2mbLHo1kS7+ARJ3UhMX3Kx1PS6dCE4 XQnc8XU/52XYuTqBYqaUdRZg/B+Dz1HX0OtbRe+7S9VfsBh0XaxwhgF4RBFktkqWXgRI z7aj2qOb/gLbi/8x2LuBmcTGQeyxrWTn6cgdFAu6nSNeuzip6VRCY8kErvCzkOjehvKM 8IQbiQwWHF9B7ZDXGOryb/19bt0I/cBym93fkBjUIEPPRl29ObjYeGwxQ07DXkXSRfFG BYgHUpsvLOs7JMgqo3EyiRs60rOKMzxxqwS2/o6HFHg18N7jYc309XoAidNa4kBoWK30 Z9ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2si4539434pgq.42.2019.02.12.02.21.54; Tue, 12 Feb 2019 02:22:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728288AbfBLKVi (ORCPT + 99 others); Tue, 12 Feb 2019 05:21:38 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:41702 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726003AbfBLKVi (ORCPT ); Tue, 12 Feb 2019 05:21:38 -0500 Received: by mail-ed1-f65.google.com with SMTP id x7so1693315eds.8 for ; Tue, 12 Feb 2019 02:21:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Zo9+FKt51sWjrcVWjLOayf+02nh5kJtN90CHM7zOA8o=; b=LwvbvKfUwU8qce3zpmFn/Y54J4mETcXmZmYcTZzndd918DD/bXFgYBRS3ytUKtgsAe WsKlGFMy7AJ54HImpFlKXTrBm3dPspeFyK+4YKe/YDVGxZNr1XxrGYVKRWsojJFVQyL9 tNfdLtQBC8exooj8FcDsv/rCMatm9SspgvUZrZu8/KuzlX+h0tE8T2E6joctgfJmfOTu uJXJoPc4UDiWJagLBTdPJXoTcViIGdg3Ebks6UJJThnL6uPNi/uXZjXC7HrDhEPYBNPI NXjd++1ytJpDm865+OBTrsc/7PLrba+ubTKjsruJmG1YLavRVn3U5gGOKbMUMAlYeLBF 1OkQ== X-Gm-Message-State: AHQUAubUHLbrkxNmGJbaXQFxhqjVELoj5XSItW6dpqu3Yaiyw0gJ2F7v t+cGvp84aaXJ9h7Bi+rZmM0= X-Received: by 2002:aa7:cb5a:: with SMTP id w26mr2430908edt.261.1549966896510; Tue, 12 Feb 2019 02:21:36 -0800 (PST) Received: from tiehlicka.microfocus.com (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id w56sm3753105edb.72.2019.02.12.02.21.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 02:21:35 -0800 (PST) From: Michal Hocko To: Andrew Morton Cc: Tetsuo Handa , David Rientjes , Johannes Weiner , Linus Torvalds , Yong-Taek Lee , , LKML , Michal Hocko , Tetsuo Handa Subject: [PATCH] proc, oom: do not report alien mms when setting oom_score_adj Date: Tue, 12 Feb 2019 11:21:29 +0100 Message-Id: <20190212102129.26288-1-mhocko@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Hocko Tetsuo has reported that creating a thousands of processes sharing MM without SIGHAND (aka alien threads) and setting /proc//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@i-love.sakura.ne.jp [2] http://lkml.kernel.org/r/20190117155159.GA4087@dhcp22.suse.cz Reported-by: Tetsuo Handa Signed-off-by: Michal Hocko --- fs/proc/base.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index 633a63462573..f5ed9512d193 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1086,10 +1086,6 @@ static int __set_oom_adj(struct file *file, int oom_adj, bool legacy) 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; -- 2.20.1