Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1400880imm; Tue, 3 Jul 2018 10:26:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJSGi9QBYuuwl3b79wQbOhXGTe9Go8pg34ZdqnqZ2kB59lIPfZt4NYAqNGg5gBODEh7ipo+ X-Received: by 2002:a65:4d91:: with SMTP id p17-v6mr25466319pgq.296.1530638801511; Tue, 03 Jul 2018 10:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530638801; cv=none; d=google.com; s=arc-20160816; b=NbNeU9wRjE3mAc/AE4skO44g2XmJljKxM9YtzEM8tIFE123BGrLVVWcIMbWYoPbd8r KXkHTxFj84R2EfUB69s/DsVjnugFA32elxXO/47UFT5YPDtDaTizHgGYpL07Zt7Y6tkF uE9uxezqepTwU3MTTeY3925LGvAcqA6sZ9k/1OAOCYX7Jz6C7rvnn/evaBNAKwXPiRuT 95a6AD615zNLRvBeZmoAndoLEd4XuwG6j78Hl6gzdQWTosG2x8LujeM9TrURSR+3wP+r +jlq+mahxZvBNoLkY+uwJ/sA90MMYnTZ980tMsTYRhRj4PzNc/QJOOUgWEwbNh5WmLw7 0FSw== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=0B/ocUBw6FbBByVsbzXHbi2XzFHDvFJ6yowEnfWrFBI=; b=SnZJf1u0yVzE753nKP5DS3Hcm2d0nQQ2fGgRzxTxWlnubGAETiw6AnspPizA5lp8Bh uGsfscf+Q3IDT+7yd+Pf57O/Ls2dcrwRUS6vlt9lqB2wiZIn50ZTAGqw4y50MliFqbcF 26mulvURQHQpRPaiAphSVXDTC1ZlzEA0WbJEHMlshH0XEcQzraoOouYW9lORQDkaZTlW RzonqLNFKQHtXcLQtHhLAb+utLqsw89HWt/8s6n1JoyqshrErVhOdNBOm5tNwk2ea8aE JrBrf+NTQoMFDy7fpO63PrQbPyTkBvZCib3SlRTGhINkDqiVYa1hb9+FaU4DZRnNVCZZ 1yKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="IFcc/9aY"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11-v6si1482421pls.399.2018.07.03.10.26.27; Tue, 03 Jul 2018 10:26:41 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="IFcc/9aY"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934296AbeGCRZi (ORCPT + 99 others); Tue, 3 Jul 2018 13:25:38 -0400 Received: from mail-ua0-f194.google.com ([209.85.217.194]:35025 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933637AbeGCRZh (ORCPT ); Tue, 3 Jul 2018 13:25:37 -0400 Received: by mail-ua0-f194.google.com with SMTP id q12-v6so1746023ual.2 for ; Tue, 03 Jul 2018 10:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=0B/ocUBw6FbBByVsbzXHbi2XzFHDvFJ6yowEnfWrFBI=; b=IFcc/9aYSZ3GitICx+iwliaLxCzI6J+xkoATcZL26G9JJRPU8d+GCiJp4rTx+/DkF3 1lxWByj+XTxbnH1UMd2tYnvca/6T6O8KgoCRh18RjaIrydAbzhsH90NWRLs9ZULEpLGd z6Wcs1W9w83dfHXoP5r9QBSb9VbYTWosfcNYJu096Ht6BoNrhmLm/v0UqNkQ88MLoB/v dD0LF+NR9LJII++e6NjclSAbG9DsE+bb80X2CYMX4bRatfBZH1FnuVecVjQUXuxo2nCX eOkNWnyCAGL0165SpvhLKVEUIkTb8lmbqrC0uBwlkrAhM56OpqlTIom+1GhuCJyDAZj9 b2ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=0B/ocUBw6FbBByVsbzXHbi2XzFHDvFJ6yowEnfWrFBI=; b=JwuOgKXF2oY4+5kv5HVovexmTTDRLQ3ed3ASDQDMwIo2d7LrNhPla4yJeFyMiFwJir z5JZF4VDMGaOnh+zFgaOZzHEmzGCNjZ8rsXCSu3ICz2nAS7pI4ENckBi0Y3rfU9CtUgX WJEg76LbVK0btptx+o5uXtMaWqLIfnLhSmHk7DLWHJJpbQ7EzixwsWbnknmwPgn0/zX0 5zTzGXB+tvpZt5WBxxHvD7iqX756v2UBUcjqyLZTYxmmr+FOYpBTV8YHLKBHoMWe9zLc 6BlXpUSZZQAl8CMWYvbJJO/v6SWUBntr+jIIvrZKWOgLbpRx0BgPWJlIxx7rWMP79piB bouQ== X-Gm-Message-State: APt69E3LhbXpm36ybZ5a0j1TDsFfkCARKXJrRETa4mtp40+yNRMytgcD JyFuFoa5RHzR78p1LHin/agiV5MsaD7IPAayKDc= X-Received: by 2002:ab0:70a9:: with SMTP id q9-v6mr10780522ual.141.1530638736224; Tue, 03 Jul 2018 10:25:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Tue, 3 Jul 2018 10:25:33 -0700 (PDT) In-Reply-To: <1530376739-20459-1-git-send-email-ufo19890607@gmail.com> References: <1530376739-20459-1-git-send-email-ufo19890607@gmail.com> From: Andy Shevchenko Date: Tue, 3 Jul 2018 20:25:33 +0300 Message-ID: Subject: Re: [PATCH v11 1/2] Refactor part of the oom report in dump_header To: ufo19890607@gmail.com Cc: Andrew Morton , Michal Hocko , David Rientjes , "Kirill A. Shutemov" , aarcange@redhat.com, Tetsuo Handa , guro@fb.com, yang.s@alibaba-inc.com, linux-mm , Linux Kernel Mailing List , yuzhoujian@didichuxing.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 30, 2018 at 7:38 PM, 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=3D,nodemask=3D,oom_memcg=3D,task_memcg=3D,task=3D,pid=3D,uid=3D > +static const char * const oom_constraint_text[] =3D { > + [CONSTRAINT_NONE] =3D "CONSTRAINT_NONE", > + [CONSTRAINT_CPUSET] =3D "CONSTRAINT_CPUSET", > + [CONSTRAINT_MEMORY_POLICY] =3D "CONSTRAINT_MEMORY_POLICY", > + [CONSTRAINT_MEMCG] =3D "CONSTRAINT_MEMCG", > +}; I'm not sure why we have this in the header. This produces a lot of noise when W=3D1. In file included from /home/andy/prj/linux-topic-mfld/include/linux/memcontrol.h:31:0, from /home/andy/prj/linux-topic-mfld/include/net/sock.h:58, from /home/andy/prj/linux-topic-mfld/include/linux/tcp.h:23= , from /home/andy/prj/linux-topic-mfld/include/linux/ipv6.h:8= 7, from /home/andy/prj/linux-topic-mfld/include/net/ipv6.h:16, from /home/andy/prj/linux-topic-mfld/net/ipv4/netfilter/nf_log_ipv4.c:17: /home/andy/prj/linux-topic-mfld/include/linux/oom.h:32:27: warning: =E2=80=98oom_constraint_text=E2=80=99 defined but not used [-W unused-const-variable=3D] static const char * const oom_constraint_text[] =3D { ^~~~~~~~~~~~~~~~~~~ CC [M] net/ipv4/netfilter/iptable_nat.o If you need (but looking at the code you actually don't if I didn't miss anything) it in several places, just export. Otherwise put it back to memcontrol.c. --=20 With Best Regards, Andy Shevchenko