linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Bujnak, Stepan" <stepan@pex.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-mm@kvack.org, Jonathan Corbet <corbet@lwn.net>,
	mcgrof@kernel.org,  hannes@cmpxchg.org
Subject: Re: [PATCH] mm/oom: added option 'oom_dump_task_cmdline'
Date: Wed, 20 Feb 2019 05:30:08 +0100	[thread overview]
Message-ID: <CAFZe2nThWxhwGAbDEPkT5nQdFR_kaRvDhhk1_1c-EvPdR7_xfw@mail.gmail.com> (raw)
In-Reply-To: <bc5d4f0f-8cbb-581a-5af3-2f178d6396fb@infradead.org>

On Wed, Feb 20, 2019 at 5:10 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> Hi,
>
> Spell it out correctly (2 places):
This is not a typo. It actually refers to the oom_dump_tasks option,
in a sense that when that option is enabled,
this option (oom_dump_task_cmdline) additionally displays task
cmdline instead of task name.
>
>
> On 2/19/19 7:22 PM, Stepan Bujnak wrote:
> > When oom_dump_tasks is enabled, this option will try to display task
>
>   When oom_dump_task_cmdline is enabled,
>
> > cmdline instead of the command name in the system-wide task dump.
> >
> > This is useful in some cases e.g. on postgres server. If OOM killer is
> > invoked it will show a bunch of tasks called 'postgres'. With this
> > option enabled it will show additional information like the database
> > user, database name and what it is currently doing.
> >
> > Other example is python. Instead of just 'python' it will also show the
> > script name currently being executed.
> >
> > Signed-off-by: Stepan Bujnak <stepan@pex.com>
> > ---
> >  Documentation/sysctl/vm.txt | 10 ++++++++++
> >  include/linux/oom.h         |  1 +
> >  kernel/sysctl.c             |  7 +++++++
> >  mm/oom_kill.c               | 20 ++++++++++++++++++--
> >  4 files changed, 36 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
> > index 187ce4f599a2..74278c8c30d2 100644
> > --- a/Documentation/sysctl/vm.txt
> > +++ b/Documentation/sysctl/vm.txt
> > @@ -50,6 +50,7 @@ Currently, these files are in /proc/sys/vm:
> >  - nr_trim_pages         (only if CONFIG_MMU=n)
> >  - numa_zonelist_order
> >  - oom_dump_tasks
> > +- oom_dump_task_cmdline
> >  - oom_kill_allocating_task
> >  - overcommit_kbytes
> >  - overcommit_memory
> > @@ -639,6 +640,15 @@ The default value is 1 (enabled).
> >
> >  ==============================================================
> >
> > +oom_dump_task_cmdline
> > +
> > +When oom_dump_tasks is enabled, this option will try to display task cmdline
>
>    When oom_dump_task_cmdline is enabled,
>
> > +instead of the command name in the system-wide task dump.
> > +
> > +The default value is 0 (disabled).
> > +
> > +==============================================================
> > +
> >  oom_kill_allocating_task
> >
> >  This enables or disables killing the OOM-triggering task in
> > diff --git a/include/linux/oom.h b/include/linux/oom.h
> > index d07992009265..461b15b3b695 100644
> > --- a/include/linux/oom.h
> > +++ b/include/linux/oom.h
> > @@ -125,6 +125,7 @@ extern struct task_struct *find_lock_task_mm(struct task_struct *p);
> >
> >  /* sysctls */
> >  extern int sysctl_oom_dump_tasks;
> > +extern int sysctl_oom_dump_task_cmdline;
> >  extern int sysctl_oom_kill_allocating_task;
> >  extern int sysctl_panic_on_oom;
> >  #endif /* _INCLUDE_LINUX_OOM_H */
> > diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> > index ba4d9e85feb8..4edc5f8e6cf9 100644
> > --- a/kernel/sysctl.c
> > +++ b/kernel/sysctl.c
> > @@ -1288,6 +1288,13 @@ static struct ctl_table vm_table[] = {
> >               .mode           = 0644,
> >               .proc_handler   = proc_dointvec,
> >       },
> > +     {
> > +             .procname       = "oom_dump_task_cmdline",
> > +             .data           = &sysctl_oom_dump_task_cmdline,
> > +             .maxlen         = sizeof(sysctl_oom_dump_task_cmdline),
> > +             .mode           = 0644,
> > +             .proc_handler   = proc_dointvec,
> > +     },
> >       {
> >               .procname       = "overcommit_ratio",
> >               .data           = &sysctl_overcommit_ratio,
>
>
> thanks.
> --
> ~Randy


  reply	other threads:[~2019-02-20  4:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20  3:22 Stepan Bujnak
2019-02-20  4:09 ` Randy Dunlap
2019-02-20  4:30   ` Bujnak, Stepan [this message]
2019-02-20  5:56     ` Randy Dunlap
2019-02-20  6:49 ` Michal Hocko
2019-02-20  8:37   ` Bujnak, Stepan
2019-02-20 10:00     ` Tetsuo Handa
2019-02-20 10:01     ` Michal Hocko

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=CAFZe2nThWxhwGAbDEPkT5nQdFR_kaRvDhhk1_1c-EvPdR7_xfw@mail.gmail.com \
    --to=stepan@pex.com \
    --cc=corbet@lwn.net \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=rdunlap@infradead.org \
    /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