From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96EF4C433E3 for ; Mon, 20 Jul 2020 13:38:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6280522BF3 for ; Mon, 20 Jul 2020 13:38:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6280522BF3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DFD4C6B0002; Mon, 20 Jul 2020 09:38:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DAE296B0005; Mon, 20 Jul 2020 09:38:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCAD16B0006; Mon, 20 Jul 2020 09:38:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id B732C6B0002 for ; Mon, 20 Jul 2020 09:38:23 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 463983F2A33 for ; Mon, 20 Jul 2020 13:38:23 +0000 (UTC) X-FDA: 77058558486.26.eggs61_2604edb26f25 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 7ED2C180192F6 for ; Mon, 20 Jul 2020 13:35:19 +0000 (UTC) X-HE-Tag: eggs61_2604edb26f25 X-Filterd-Recvd-Size: 4647 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Jul 2020 13:35:19 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id a14so3024012wra.5 for ; Mon, 20 Jul 2020 06:35:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0dIBDhRf0PvLp1Tct6z20zV5kO5cCV8tX7hZkCkBMJE=; b=eL0Ow2NzV+pT043W88IVZdHPKB01Oj6+0EO+6jlU1PGtKEb1O9GKEJ2ER/vUThJLDf JWiV6LB7KEKryASWkBAoPQv2LJBJayIEXq2lOCiylujQbr8M3zKzm19yfYstPdDoLnbX 3ttKBeDO8wYn+d+BXE1s3bwpW2ObzkmDpvxLPKChTJPeuMSO+Q1OfWQcS59+wBoFfTGx z/i/Vw+Tb6vImN/BdxvFMaCEZGHAGBdsrJM/mCOZh1Z19rryGUqyYo8nNh9AOPXSm4EV U2MoLz3jikNoceRM4L98v+2vm54aeH0Cqw34z/KVsrl7nrYLWlOVewMZg9Np/ZkxgRfL RkXA== X-Gm-Message-State: AOAM533sEqqobvPjgtVJ2/ZpSZEJnYgwnrPMwsbaqHDKJhziJVGV8gw4 slwa3/yGm6aLGbY5Vasz7MA= X-Google-Smtp-Source: ABdhPJzouVHA89C8LnXCmitFF8j+/Wt7rB/sy89OGDs02rt83XuaBqibhjhLBjAHuZS2mfoVdW6g8A== X-Received: by 2002:adf:bc4b:: with SMTP id a11mr1742086wrh.381.1595252117551; Mon, 20 Jul 2020 06:35:17 -0700 (PDT) Received: from localhost (ip-37-188-169-187.eurotel.cz. [37.188.169.187]) by smtp.gmail.com with ESMTPSA id t2sm32094951wma.43.2020.07.20.06.35.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2020 06:35:16 -0700 (PDT) Date: Mon, 20 Jul 2020 15:35:14 +0200 From: Michal Hocko To: Yafang Shao Cc: David Rientjes , Tetsuo Handa , Andrew Morton , Linux MM Subject: Re: [PATCH] mm, oom: show process exiting information in __oom_kill_process() Message-ID: <20200720133514.GF4074@dhcp22.suse.cz> References: <1595166795-27587-1-git-send-email-laoar.shao@gmail.com> <20200720071607.GA18535@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 7ED2C180192F6 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon 20-07-20 18:36:53, Yafang Shao wrote: > On Mon, Jul 20, 2020 at 3:16 PM Michal Hocko wrote: > > > > On Sun 19-07-20 09:53:15, Yafang Shao wrote: > > > 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 > > > --- > > > mm/oom_kill.c | 6 +++++- > > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > > > index 6e94962..0480dde 100644 > > > --- a/mm/oom_kill.c > > > +++ b/mm/oom_kill.c > > > @@ -863,9 +863,13 @@ static void __oom_kill_process(struct task_struct *victim, const char *message) > > > > > > p = find_lock_task_mm(victim); > > > if (!p) { > > > + pr_info("Process %d (%s) is already exiting\n", > > > + task_pid_nr(victim), victim->comm); > > > put_task_struct(victim); > > > > I do agree that a silent bail out is not the best thing to do. The above > > message would be more useful if it also explained what the oom killer > > does (or does not): > > > > "OOM victim %d (%s) is already exiting. Skip killing the task\n" > > > > Sure. > > > > return; > > > - } else if (victim != p) { > > > + } > > > + > > > + if (victim != p) { > > > > Why do we need this? > > > > Because I don't like that code style. We usually prefer to keep unrelated changes separate. Minor coding style changes are usually questionable because many people have different sense for the code. > But it is not a big problem, I will not change it in the next version. Thanks -- Michal Hocko SUSE Labs