linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Roman Guschin <guroan@gmail.com>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Tejun Heo <tj@kernel.org>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vlastimil Babka <vbabka@suse.cz>,
	Michal Hocko <mhocko@kernel.org>,
	hannes@cmpxchg.org
Subject: Re: [PATCH] mm/oom_kill: count global and memory cgroup oom kills
Date: Fri, 19 May 2017 17:34:18 +0100	[thread overview]
Message-ID: <CALo0P1123MROxgveCdX6YFpWDwG4qrAyHu3Xd1F+ckaFBnF4dQ@mail.gmail.com> (raw)
In-Reply-To: <149520375057.74196.2843113275800730971.stgit@buzz>

2017-05-19 15:22 GMT+01:00 Konstantin Khlebnikov <khlebnikov@yandex-team.ru>:
> Show count of global oom killer invocations in /proc/vmstat and
> count of oom kills inside memory cgroup in knob "memory.events"
> (in memory.oom_control for v1 cgroup).
>
> Also describe difference between "oom" and "oom_kill" in memory
> cgroup documentation. Currently oom in memory cgroup kills tasks
> iff shortage has happened inside page fault.
>
> These counters helps in monitoring oom kills - for now
> the only way is grepping for magic words in kernel log.
>
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> ---
>  Documentation/cgroup-v2.txt   |   12 +++++++++++-
>  include/linux/memcontrol.h    |    1 +
>  include/linux/vm_event_item.h |    1 +
>  mm/memcontrol.c               |    2 ++
>  mm/oom_kill.c                 |    6 ++++++
>  mm/vmstat.c                   |    1 +
>  6 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/cgroup-v2.txt b/Documentation/cgroup-v2.txt
> index dc5e2dcdbef4..a742008d76aa 100644
> --- a/Documentation/cgroup-v2.txt
> +++ b/Documentation/cgroup-v2.txt
> @@ -830,9 +830,19 @@ PAGE_SIZE multiple when read back.
>
>           oom
>
> +               The number of time the cgroup's memory usage was
> +               reached the limit and allocation was about to fail.
> +               Result could be oom kill, -ENOMEM from any syscall or
> +               completely ignored in cases like disk readahead.
> +               For now oom in memory cgroup kills tasks iff shortage
> +               has happened inside page fault.

>From a user's point of view the difference between "oom" and "max"
becomes really vague here,
assuming that "max" is described almost in the same words:

"The number of times the cgroup's memory usage was
about to go over the max boundary.  If direct reclaim
fails to bring it down, the OOM killer is invoked."

I wonder, if it's better to fix the existing "oom" value  to show what
it has to show, according to docs,
rather than to introduce a new one?

> +
> +         oom_kill
> +
>                 The number of times the OOM killer has been invoked in
>                 the cgroup.  This may not exactly match the number of
> -               processes killed but should generally be close.
> +               processes killed but should generally be close: each
> +               invocation could kill several processes at once.
>
>    memory.stat
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2017-05-19 16:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19 14:22 Konstantin Khlebnikov
2017-05-19 14:32 ` Michal Hocko
2017-05-19 16:34 ` Roman Guschin [this message]
2017-05-22  9:11   ` Konstantin Khlebnikov
2017-05-22 18:05     ` Roman Guschin
2017-05-23  7:49     ` David Rientjes
2017-05-23 10:32       ` Konstantin Khlebnikov
2017-05-24 20:43         ` David Rientjes
2017-05-25  8:44           ` Konstantin Khlebnikov
2017-05-23  7:27 ` Michal Hocko
2017-05-23 11:05   ` Konstantin Khlebnikov
2017-05-23 11:29     ` Tetsuo Handa

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=CALo0P1123MROxgveCdX6YFpWDwG4qrAyHu3Xd1F+ckaFBnF4dQ@mail.gmail.com \
    --to=guroan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=tj@kernel.org \
    --cc=vbabka@suse.cz \
    /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