Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp290873imm; Tue, 3 Jul 2018 19:27:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdzlNM45mGo4Jsz++tw3ULYIB5hKMPOD4kE7CNfkl53kixKPuHj9hfrFp6wGpapAHZfs/ys X-Received: by 2002:a62:a05:: with SMTP id s5-v6mr177988pfi.147.1530671262923; Tue, 03 Jul 2018 19:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530671262; cv=none; d=google.com; s=arc-20160816; b=rKWj2GTNSvdp6ooxuOJ4QdFMGMFaK8DCgdLxU+Z1RCEW5O8r3rUs+9F8TezGQxNQzs Uvihzt6xA5UqXIieIbA72098C5RTDBwOicoyCyMcMX1Vs5IXPuR/rRXvir5HsAhU/xwC qSETtXO0Lz2eGOpE6DaTKEDbN/SmCI6zPYXDm0duZKXUHceA7VHXEhqFG5LDTYVpmG96 0xaUmNP4nI8muo2ka6SkJ2q91d8W1L6N6mNlYgOjM3E4Bm2Vu1DtMUjdC8SqkcKXdn7T V3NjBihjnG8AjMj7MtdEPHWtrz/UgXcSqoSJKoFob8lhuEOaF1YQa20qVkJHbnfvVPz0 xMEg== 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:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=ZTww2MKkNZZyRk3Zr43hPVrkLJ3/5/a2mmGVcbT7H6o=; b=M26gg6i54dx7dX99BvPyThRPAf7OLYgXu7uiyes5ehQyT27GMV+YsH1JOue2D+BALq zhcInlKo0iP/h9OLEpA5EIWj5kWtV1z+O9nqde5jbjhWTOev/pqNgGhali3fNX3/rSYC bKkDIDWSblg130zF42TCygjMoTgYcIczoFhjWee7K+qvNAH/ScQkdRHnB6ghFrp9frBa 5dJNikEuXdMhUm3XOqbhcgymHdDRwU/YEHtwE4d2oN2wCo/C1zzci1rbUYsxhteGmiF8 SWjOmIwwHgWQ3UZaAJvAvM1DHH6q8LeWUfGyEaffnyaqQWuXez1NbAIlUao1gVmDFylE 4PTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PM54rj4O; 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 r14-v6si2304164pgl.490.2018.07.03.19.27.28; Tue, 03 Jul 2018 19:27:42 -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=PM54rj4O; 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 S1753561AbeGDCZo (ORCPT + 99 others); Tue, 3 Jul 2018 22:25:44 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35597 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753466AbeGDCZn (ORCPT ); Tue, 3 Jul 2018 22:25:43 -0400 Received: by mail-lf0-f67.google.com with SMTP id i15-v6so3128366lfc.2 for ; Tue, 03 Jul 2018 19:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ZTww2MKkNZZyRk3Zr43hPVrkLJ3/5/a2mmGVcbT7H6o=; b=PM54rj4OSA6cwU69/dfaxpSGCwYL1SsH9NKjTXDXCShoEEiG9rxAnmMR+9nGyTUn9/ gRwaB6S0D7wDXgnNz8vQ2kvnHqXELczEdnzdEb8RMSuh+0KA9qgvEzOJyrdR/iGqKJYO cYaGvM80ba2r6SHDkqilxZiqy2QkX1dvlez2QbyPQtQl9Tmpqi0uoCwpswEzkn7NseXP lXjPxyhF0nAebTTpcdawm3+1gfAVpafi61qnDopphXFZ4HEQ7YhMyUKQivayEBq7Ha3o sxqFU1B7w1tYZ/REpJ6lK8A3bgRvsWa/kfEJh4oqbUc7pezkZ6mHu+7OEKC60IoNmcmM vXlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ZTww2MKkNZZyRk3Zr43hPVrkLJ3/5/a2mmGVcbT7H6o=; b=i4Sj5KAUaZJlX64RlFCK+0eAYDqbzsDPBExPc5b7+UfwOaVmPg3Y0m5JaWiCQuigl6 0q1oxtlq+67GL1A2N698SnUx3J5SB0Ipp1lis/swd7Y+kKbmryQMkC16uxaT7E2oFgnI FLIQGpZXIpahT1Vc2Xm/tbPvLuSOZczmHe8SaRp9OVeW3j2t7xMao/rBWK770a8TsMzk 6fyztZtp8aK0ouDfUkQt0Qh4GSiuroq9ua01RicMA936t/2jdbJt9qzVhDWyisb7tcde f1L0thQ64G97ruWvMeofoTNWihOqSE+c4TsFcdw99k6odxyRP/bIlxGgkiWCyOvbueRd zYQw== X-Gm-Message-State: APt69E10rpcNplYd3k40tZ22FR34c1f3W6sUMT2UY7vEfnp+THY/cGJY dY6I2I/xF+iSfA5BCNYXrXksMJ9hypFx/uuyJ38= X-Received: by 2002:a19:e40d:: with SMTP id b13-v6mr76982lfh.141.1530671142227; Tue, 03 Jul 2018 19:25:42 -0700 (PDT) MIME-Version: 1.0 References: <1530376739-20459-1-git-send-email-ufo19890607@gmail.com> In-Reply-To: From: =?UTF-8?B?56a56Iif6ZSu?= Date: Wed, 4 Jul 2018 10:25:30 +0800 Message-ID: Subject: Re: [PATCH v11 1/2] Refactor part of the oom report in dump_header To: andy.shevchenko@gmail.com Cc: akpm@linux-foundation.org, 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, Wind Yu 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 Hi Andy The const char array need to be used by the new func mem_cgroup_print_oom_context and some funcs in oom_kill.c in the second patch. Thanks > > 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 fin= d > > 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:5= 8, > from /home/andy/prj/linux-topic-mfld/include/linux/tcp.h:= 23, > from /home/andy/prj/linux-topic-mfld/include/linux/ipv6.h= :87, > from /home/andy/prj/linux-topic-mfld/include/net/ipv6.h:1= 6, > 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. > > -- > With Best Regards, > Andy Shevchenko