From patchwork Tue Jul 21 01:01:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 11674789 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08D24138C for ; Tue, 21 Jul 2020 01:01:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C9C8B20B1F for ; Tue, 21 Jul 2020 01:01:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PxtBOys7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9C8B20B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D98156B000C; Mon, 20 Jul 2020 21:01:56 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D48326B0010; Mon, 20 Jul 2020 21:01:56 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5EB58D0002; Mon, 20 Jul 2020 21:01:56 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0134.hostedemail.com [216.40.44.134]) by kanga.kvack.org (Postfix) with ESMTP id AE14C6B000C for ; Mon, 20 Jul 2020 21:01:56 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 68C8C8366D09 for ; Tue, 21 Jul 2020 01:01:56 +0000 (UTC) X-FDA: 77060281032.18.rate55_2e085da26f29 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 3E67B100EE6A3 for ; Tue, 21 Jul 2020 01:01:56 +0000 (UTC) X-Spam-Summary: 1,0,0,90323fdc5ec7cba6,d41d8cd98f00b204,laoar.shao@gmail.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1345:1437:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:2693:2892:3138:3139:3140:3141:3142:3352:3865:3867:3868:3871:3872:4250:4321:5007:6119:6261:6653:7514:7875:7903:9413:10004:11026:11658:11914:12043:12048:12296:12297:12517:12519:12533:12555:12895:12986:13069:13075:13095:13311:13357:14181:14384:14394:14687:14721:21080:21324:21433:21444:21451:21627:21666:21990:30054:30056:30075,0,RBL:209.85.222.193:@gmail.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100;04y87heh79f6u1wyoexgg6przcph9ypdparmcw3yc91ofc58mefjdapmj5udb9x.8oj86idwq75b6py5p97uf94ff7yt4q9o6gxu5nxgdryfw6nkf35w7jgnfhj5m61.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: rate55_2e085da26f29 X-Filterd-Recvd-Size: 3860 Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Tue, 21 Jul 2020 01:01:55 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id b4so17750769qkn.11 for ; Mon, 20 Jul 2020 18:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=vQhjiS4z2qwzMJEE3YMBlNnKF1JfXfnwSnhQG0p+k+U=; b=PxtBOys7tO3sak7slXiKuToB/3kOfrxEUp08Y/v/LEeAE9eWuwTeMudKGl4tbWfuxG uWeOwqv6Z06DdxQlmnx2AqJ2v2nVoSmNhWrdd+lcY9C0QGlY8TKfSO7GFt20693H/tfb TT+WC8FqXp1YxEtkyk/7ZGM0Z0fzM5dFPgPuQNHNgewhtP7VhEmFVdJiXUsuiyZxWqD8 FuXngtqqVqjJUI7DoZWPuWEcEI8VjHyrGRT7hCcDl6jizgdw4LMkNB2mYnHq4L9FjrUK Hy3ApxYprcvf7EKeqcbTX9a0g8K8uBFUlGuLm4SvlZ/urc6QZBJI9OWLlwBsfdzpnsms vNYQ== 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; bh=vQhjiS4z2qwzMJEE3YMBlNnKF1JfXfnwSnhQG0p+k+U=; b=G2USb5mT9HJbQEhiy+yDsPaOey4Cy2zEwcFN4wIiMidy8Za04UzG2/wBJ4BRR/I1hA 4U7fbMTpUziUtzJvbInwKrdnRyW4KuVWC6B8IeKrquA16SJtCj1D1guGd1bM2dzgYSvh t3/ufki/yLCaYAUpAHg1f7frDMCyfRH0hvwvUh2mOb/3ienzvvJi3I73QFRGHsL1/y4d x3sipXQR3Z9gF0D1Qmowt29k/opY4vrOD5dMuYSECSEqlAgAGkzzAYFbgzCu8RHwnKht STxGGZVhnrfFetRLoTMpst8zPV5GXL3qQycCOThkIjwNib5AEMh8fu9wqQr3k593hkGs MPAA== X-Gm-Message-State: AOAM530Nu/tGkRfPmeefHy8AZ8pQSQpgl/CIfcvvydmaHeixFTZT48s7 zwYWdlCfAybY+oA5vaK4Yo8= X-Google-Smtp-Source: ABdhPJyVPWiYXPiVSRBtMDdfXRAtFrRW6BqHoh/y0gkMm16+oa7lBZX3Lw1YWuUfAyEvyiAb7t/2Ag== X-Received: by 2002:a37:9147:: with SMTP id t68mr23927305qkd.34.1595293315174; Mon, 20 Jul 2020 18:01:55 -0700 (PDT) Received: from localhost.localdomain ([183.134.211.52]) by smtp.gmail.com with ESMTPSA id c80sm981673qkg.72.2020.07.20.18.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2020 18:01:54 -0700 (PDT) From: Yafang Shao To: rientjes@google.com, mhocko@kernel.org, penguin-kernel@i-love.sakura.ne.jp, akpm@linux-foundation.org, cai@lca.pw Cc: linux-mm@kvack.org, Yafang Shao Subject: [PATCH v2] mm, oom: show process exiting information in __oom_kill_process() Date: Mon, 20 Jul 2020 21:01:27 -0400 Message-Id: <20200721010127.17238-1-laoar.shao@gmail.com> X-Mailer: git-send-email 2.18.1 X-Rspamd-Queue-Id: 3E67B100EE6A3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.003367, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When the OOM killer finding a victim and trying to kill it, if the victim is already exiting, the task mm will be NULL and no process will be killed. But the dump_header() has been already executed, so it will be strange to dump so many information without killing a process. We'd better show some helpful information to indicate why this happens. Suggested-by: David Rientjes Signed-off-by: Yafang Shao Cc: Michal Hocko Cc: Tetsuo Handa Cc: Qian Cai Acked-by: Michal Hocko --- v1 -> v2: - improve the output, per Tetsuo and Michal --- mm/oom_kill.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 6e94962893ee..c176c988c109 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -863,6 +863,8 @@ static void __oom_kill_process(struct task_struct *victim, const char *message) p = find_lock_task_mm(victim); if (!p) { + pr_info("%s: OOM victim %d (%s) is already exiting. Skip killing the task\n", + message, task_pid_nr(victim), victim->comm); put_task_struct(victim); return; } else if (victim != p) {