Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp662225imm; Sat, 8 Sep 2018 06:37:49 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda68O8N4UJ8KVzBGrI+SGhJOsl6zL58snp9FDPDnG9fJ1WhPGnZRdYWM4+L1R0rhuvpwVdX X-Received: by 2002:a17:902:e00b:: with SMTP id ca11-v6mr12732995plb.224.1536413869803; Sat, 08 Sep 2018 06:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536413869; cv=none; d=google.com; s=arc-20160816; b=WGjVNzTBNJ/2bV8H871kSre8Gto90Jq8HMwa4jFD56nXlD/aN98hwxQpch0qm2zPhQ i5W21t0HY1A4YDVLIPkW8WQCz7eufUNwtvDt+ClW5q35W9dx2Q5UUTl2bxA+KMO3B0Zt VbH0QCeTIUDYZQSmaZ35rx15xxKYBjWbN/wNuItK4ng/QMGlXgU5vLpQ/NBIhS22mmmI 8CcowsMYdk2kOt2QQqGuzimewBTwi/TBQOwpnnrk8pMKEIlUNZSA7qkBoyezuCQw2gNi 22PoTDXlhza8tX8/8oNwbhsjIkcUbG6+4y+er+PHwpybbSsNM/D6uK5eu3d4RLoco4Tp /+iw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=9MHJHrxHj19XJZ+X9DNgOKbh3UbewMABV4AweAtsgoI=; b=EW8IRVoEXcz7wizwCb+7bCyVI298cqpJXLjpT/2pvw9xc4Rq4P2KNCJ8HljBZJZsFH vrI3P/aYVxLmCBqNvXhM/yPQtYDadtQnLMGfuXznJ3IcZSkFAUqbRfDuL2W8j8uNWBgI 4+7LZtH5XjYtt+m0lbpVJabNnhRS4wnPuiYpPTeqCFNsxa4WZesgT7rbWiYSJPzcGORA LDUdeNuXmFwILZ+6+8VhTFQTh3ODk83d+n5MvYsVPr+Vfz5ZzIxylGoankUOMyo8n7jz ew5CwVFD/z0g/09RAuZww88cIlpe8j+NINywP5EDkw+pPOqkjAFhzSmejvBHDOe4nVJG ShaA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16-v6si11719228pgd.257.2018.09.08.06.37.31; Sat, 08 Sep 2018 06:37:49 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726778AbeIHSWP (ORCPT + 99 others); Sat, 8 Sep 2018 14:22:15 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:45326 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbeIHSWO (ORCPT ); Sat, 8 Sep 2018 14:22:14 -0400 Received: from fsav109.sakura.ne.jp (fsav109.sakura.ne.jp [27.133.134.236]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id w88DaDRg046045; Sat, 8 Sep 2018 22:36:13 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav109.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav109.sakura.ne.jp); Sat, 08 Sep 2018 22:36:13 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav109.sakura.ne.jp) Received: from [192.168.1.8] (softbank060157066051.bbtec.net [60.157.66.51]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id w88Da7Qe046008 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 8 Sep 2018 22:36:12 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Subject: Re: [PATCH] mm: memcontrol: print proper OOM header when no eligible victim left To: Johannes Weiner , Andrew Morton Cc: Michal Hocko , Dmitry Vyukov , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180821160406.22578-1-hannes@cmpxchg.org> From: Tetsuo Handa Message-ID: Date: Sat, 8 Sep 2018 22:36:06 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180821160406.22578-1-hannes@cmpxchg.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/08/22 1:04, Johannes Weiner wrote: > When the memcg OOM killer runs out of killable tasks, it currently > prints a WARN with no further OOM context. This has caused some user > confusion. > > Warnings indicate a kernel problem. In a reported case, however, the > situation was triggered by a non-sensical memcg configuration (hard > limit set to 0). But without any VM context this wasn't obvious from > the report, and it took some back and forth on the mailing list to > identify what is actually a trivial issue. > > Handle this OOM condition like we handle it in the global OOM killer: > dump the full OOM context and tell the user we ran out of tasks. > > This way the user can identify misconfigurations easily by themselves > and rectify the problem - without having to go through the hassle of > running into an obscure but unsettling warning, finding the > appropriate kernel mailing list and waiting for a kernel developer to > remote-analyze that the memcg configuration caused this. > > If users cannot make sense of why the OOM killer was triggered or why > it failed, they will still report it to the mailing list, we know that > from experience. So in case there is an actual kernel bug causing > this, kernel developers will very likely hear about it. > > Signed-off-by: Johannes Weiner > Acked-by: Michal Hocko > --- > mm/memcontrol.c | 2 -- > mm/oom_kill.c | 13 ++++++++++--- > 2 files changed, 10 insertions(+), 5 deletions(-) > Now that above patch went to 4.19-rc3, please apply below one. From eb2bff2ed308da04785bcf541dd3f748286bfa23 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Sat, 8 Sep 2018 22:26:28 +0900 Subject: [PATCH] mm, oom: Don't emit noises for failed SysRq-f. Due to commit d75da004c708c9fc ("oom: improve oom disable handling") and commit 3100dab2aa09dc6e ("mm: memcontrol: print proper OOM header when no eligible victim left"), all kworker/0:1 invoked oom-killer: gfp_mask=0x6000c0(GFP_KERNEL), nodemask=(null), order=-1, oom_score_adj=0 (...snipped...) Out of memory and no killable processes... OOM request ignored. No task eligible lines are printed. Let's not emit "invoked oom-killer" lines when SysRq-f failed. Signed-off-by: Tetsuo Handa --- mm/oom_kill.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index f10aa53..92122ef 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -1106,8 +1106,10 @@ bool out_of_memory(struct oom_control *oc) select_bad_process(oc); /* Found nothing?!?! */ if (!oc->chosen) { - dump_header(oc, NULL); - pr_warn("Out of memory and no killable processes...\n"); + if (!is_sysrq_oom(oc)) { + dump_header(oc, NULL); + pr_warn("Out of memory and no killable processes...\n"); + } /* * If we got here due to an actual allocation at the * system level, we cannot survive this and will enter -- 1.8.3.1