Re: [PATCH] mm/oom: added option 'oom_dump_task_cmdline'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 20, 2019 at 5:10 AM Randy Dunlap <rdunlap@xxxxxxxxxxxxx> 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@xxxxxxx>
> > ---
> >  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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux