From: David Rientjes <rientjes@google.com>
To: ufo19890607 <ufo19890607@gmail.com>
Cc: akpm@linux-foundation.org, mhocko@suse.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 <yuzhoujian@didichuxing.com>
Subject: Re: [PATCH v5] Refactor part of the oom report in dump_header
Date: Fri, 25 May 2018 12:48:54 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.21.1805251245210.158701@chino.kir.corp.google.com> (raw)
In-Reply-To: <1527213613-7922-1-git-send-email-ufo19890607@gmail.com>
On Fri, 25 May 2018, ufo19890607 wrote:
> From: yuzhoujian <yuzhoujian@didichuxing.com>
>
> The dump_header does not print the memcg's name when the system
> oom happened, so users cannot locate the certain container which
> contains the task that has been killed by the oom killer.
>
> I follow the advices of David Rientjes and Michal Hocko, and refactor
> part of the oom report in a backwards compatible way. After this patch,
> users can get the memcg's path from the oom report and check the certain
> container more quickly.
>
I like the direction you are taking. A couple notes:
- you may find it easier to declare an array of const char * for each
constraint:
static const char * const oom_constraint_text[] = {
[CONSTRAINT_NONE] = "CONSTRAINT_NONE",
[CONSTRAINT_CPUSET] = "CONSTRAINT_CPUSET",
[CONSTRAINT_MEMORY_POLICY] = "CONSTRAINT_MEMORY_POLICY",
[CONSTRAINT_MEMCG] = "CONSTRAINT_MEMCG",
};
- we need to eliminate all the usage of pr_cont() because otherwise we
can still get interleaving in the kernel log (the single line output
should always be a complete single line that can be parsed by
userspace).
- to generate a single line output, I think you need a call to a
function in mm/memcontrol.c when is_memcg_oom(oc) is true and
otherwise a function in mm/oom_kill.c when false.
prev parent reply other threads:[~2018-05-25 19:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-25 2:00 ufo19890607
2018-05-25 19:48 ` David Rientjes [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.21.1805251245210.158701@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=guro@fb.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=ufo19890607@gmail.com \
--cc=yang.s@alibaba-inc.com \
--cc=yuzhoujian@didichuxing.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox