Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1010162imm; Tue, 3 Jul 2018 04:04:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeWdWFDZmgZ19sISpAF3vWA5avMtShBGd53ywvzGZSUyw+gZwLAi3/LBgu3TVuQG5AadhbR X-Received: by 2002:a62:9f16:: with SMTP id g22-v6mr28735109pfe.207.1530615876956; Tue, 03 Jul 2018 04:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530615876; cv=none; d=google.com; s=arc-20160816; b=lmfLtxDgDlEkAQQzNxx+uK5+MgRV8nhZsjUpsAEutQI90Ij51liRH07o95Ww9gIXu3 ksQo5yRIz3xSdBMHhJ4zjH148ie06Jq3dNnDQkvr7R7gkdmu676jMb/q5JE6X6ay02zj 6nT1zq68AFTFcRQe++yn18SudjWw4ifgymYwzCShq9/q1mxIgegliSikaLvNirq4Hrm2 Sr3N5fVW49JEQ11gz2dHyQkD4Cc+8MTOAulYxLrqcQW+dVoM1OD6oo6GZRETYCRYH2Ev rdNJ3jQKT88Bfetqf9o+VVbuPuSfblCniHR7mfXpxsxYFbaRDwge9cqo/tYFaHxA1Gl3 ljAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=4wmFmFVkoD+ariWl08jOPo8tw/ypGv5Ba6Mqpe6RGjs=; b=Waz1E1m7qHYN7n0cPIMhFuDP4DBPPgVAamt3KePfwlCjLUIpEfSFuY4RZCUHQrTg9G Zk2O7BkvCiipgxaawFWrc5+upE3JADOVfn4jJqbSd+mhpvj5FrdmLa8ZgFz/kJgF/R0l I3i3O5CUTNPbSYlhcsBZSNUHOnh+wha8MoZZkibvZ8V2/2JVNjfLJpGkmhW1MiGdvC/3 SP4WWyeITAI913VpdLusuEshXeMPFtE35YSBb09goVigtskmaZNRjDnXvsW/2Tp5714w CRTfznk6PtC7Dv/6dAYLD768npd7DeqD/YAmQ0WVgan6c7iAeJfyPJsWc6p7xZy3EAEY cmag== 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 1-v6si783576plx.227.2018.07.03.04.04.22; Tue, 03 Jul 2018 04:04:36 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753055AbeGCLDp (ORCPT + 99 others); Tue, 3 Jul 2018 07:03:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:50494 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752552AbeGCLDo (ORCPT ); Tue, 3 Jul 2018 07:03:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4A7A4AFC9; Tue, 3 Jul 2018 11:03:43 +0000 (UTC) Date: Tue, 3 Jul 2018 13:03:35 +0200 From: Michal Hocko To: =?utf-8?B?56a56Iif6ZSu?= Cc: akpm@linux-foundation.org, rientjes@google.com, kirill.shutemov@linux.intel.com, aarcange@redhat.com, penguin-kernel@i-love.sakura.ne.jp, guro@fb.com, yang.s@alibaba-inc.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wind Yu Subject: Re: [PATCH v11 1/2] Refactor part of the oom report in dump_header Message-ID: <20180703110335.GH16767@dhcp22.suse.cz> References: <1530376739-20459-1-git-send-email-ufo19890607@gmail.com> <20180702101732.GD19043@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 03-07-18 18:57:14, 禹舟键 wrote: > Hi Michal > cpuset_print_current_mems_allowed is also invoked by > warn_alloc(page_alloc.c). So, can I remove the current->comm output in > the pr_info ? > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index d8b12e0d39cd..09b8ef6186c6 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -2666,9 +2666,9 @@ void cpuset_print_current_mems_allowed(void) > rcu_read_lock(); > > cgrp = task_cs(current)->css.cgroup; > - pr_info("%s cpuset=", current->comm); > + pr_info(",cpuset="); > pr_cont_cgroup_name(cgrp); > - pr_cont(" mems_allowed=%*pbl\n", > + pr_cont(",mems_allowed=%*pbl", > nodemask_pr_args(¤t->mems_allowed)); Yes, I think so. Just jam the cpuset info to the allocation context warning like this diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1521100f1e63..6bc7d5d4007a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3416,12 +3416,13 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...) va_start(args, fmt); vaf.fmt = fmt; vaf.va = &args; - pr_warn("%s: %pV, mode:%#x(%pGg), nodemask=%*pbl\n", + pr_warn("%s: %pV, mode:%#x(%pGg), nodemask=%*pbl", current->comm, &vaf, gfp_mask, &gfp_mask, nodemask_pr_args(nodemask)); va_end(args); cpuset_print_current_mems_allowed(); + pr_cont("\n"); dump_stack(); warn_alloc_show_mem(gfp_mask, nodemask); -- Michal Hocko SUSE Labs