Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7055059imm; Wed, 27 Jun 2018 19:12:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLUjggZF4W3RJ6g8XaIXN1SvD0m0Pm1NZxSWh5akLETKSGiIVTBtAqBrE4yCMv8qRn7O/R9 X-Received: by 2002:a17:902:201:: with SMTP id 1-v6mr8669997plc.310.1530151937545; Wed, 27 Jun 2018 19:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530151937; cv=none; d=google.com; s=arc-20160816; b=Vvtrk46kvsq0ZiQjFHj4ehz/N6p4wBAnCqKX1FqVqCKO56kC53dd0j8/wBL5G4YUEY OtD4kF7+qFajWen3uEqdTBVMMXitcEh+lqDIexFHlkf+68yTUOTk2LPm0BNzYpoMsR4+ tazMparLgqK//SktBweOkAEXbTXcJh1vdz4a2MMneGihc4kEsOsmvpfd11f42RnSu1wC 9KEILPs7Fxq6clYx55vZii6LmSpMJABbct4McH5JxrAeS34HuhpIhL1zuhb6RK3fw4Vw OoHkuTbh1WLzcSbcEV3g7dsHd90LM8NY+cRI6auNenOfR6+9bWCHr54udHSxdfrNX1z7 eryA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=7HZJcXeV2HTVfehm/GwhwpptfXr8ChBqupAH4N+R6TQ=; b=ntySGezuoldhIdq9LnjNSPTtyHQAOcQwZ5kjSEAafTO71jIzitdepreXkj9dvDU1Ys OjMb5/9pZynD2MP0sj7otBZ2XsX6SaZFrJfvCZk4hup4+iFcwN5E/rNkawecOKhmlk3/ YoNtY2u7HPsivz9zOKp1vwY1AMnthVmM/TbHNQGbgMuYYYkS6sxRcgGpJZO7Vj1DYtL0 qqwWajH+qM3Unlc+5IdHUTaY4Uf2wrBIulYBf8I3Iy89dp4tcL08owwNGzGUD359z3wd ziWBtHHHeKKOlejdPmHEUdFiG6hLTE19neWgPq79buaEf4BRMHcvC/ExdEMq6JvrROcX zkVQ== 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 q18-v6si4637758pgt.529.2018.06.27.19.12.02; Wed, 27 Jun 2018 19:12:17 -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 S1753045AbeF1CKo (ORCPT + 99 others); Wed, 27 Jun 2018 22:10:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54710 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752544AbeF1CKn (ORCPT ); Wed, 27 Jun 2018 22:10:43 -0400 Received: from localhost.localdomain (c-24-4-125-7.hsd1.ca.comcast.net [24.4.125.7]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CABB9CA1; Thu, 28 Jun 2018 02:10:42 +0000 (UTC) Date: Wed, 27 Jun 2018 19:10:41 -0700 From: Andrew Morton To: ufo19890607@gmail.com Cc: mhocko@suse.com, 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, yuzhoujian@didichuxing.com Subject: Re: [PATCH v10 2/2] Refactor part of the oom report in dump_header Message-Id: <20180627191041.509893a3b43f95a27df32266@linux-foundation.org> In-Reply-To: <1529763171-29240-2-git-send-email-ufo19890607@gmail.com> References: <1529763171-29240-1-git-send-email-ufo19890607@gmail.com> <1529763171-29240-2-git-send-email-ufo19890607@gmail.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 23 Jun 2018 22:12:51 +0800 ufo19890607@gmail.com wrote: > From: yuzhoujian > > The current system wide oom report prints information about the victim > and the allocation context and restrictions. It, however, doesn't > provide any information about memory cgroup the victim belongs to. This > information can be interesting for container users because they can find > the victim's container much more easily. > > I follow the advices of David Rientjes and Michal Hocko, and refactor > part of the oom report. After this patch, users can get the memcg's > path from the oom report and check the certain container more quickly. > > The oom print info after this patch: > oom-kill:constraint=,nodemask=,oom_memcg=,task_memcg=,task=,pid=,uid= > > Signed-off-by: yuzhoujian > --- > Below is the part of the oom report in the dmesg > ... > [ 134.873392] panic invoked oom-killer: gfp_mask=0x6280ca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), nodemask=(null), order=0, oom_score_adj=0 > > ... > > [ 134.873480] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),task_memcg=/test/test1/test2,task=panic,pid= 8669, uid= 0 We're displaying nodemask twice there. Avoidable? Also, the spaces after pid= and uid= don't seem useful. Why not use plain old %d?