linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ying Han <yinghan@google.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	David Rientjes <rientjes@google.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Oleg Nesterov <oleg@redhat.com>
Subject: Re: [PATCH resend] oom: do not kill tasks with oom_score_adj OOM_SCORE_ADJ_MIN
Date: Wed, 9 Nov 2011 10:24:01 -0800	[thread overview]
Message-ID: <CALWz4ixzXXueAn_hMKiC-BRc-cRbFkmCbDgy=VJjsuXRZD_qDg@mail.gmail.com> (raw)
In-Reply-To: <20111109090919.C2D538AD27@mx2.suse.de>

[-- Attachment #1: Type: text/plain, Size: 1649 bytes --]

On Fri, Nov 4, 2011 at 4:59 AM, Michal Hocko <mhocko@suse.cz> wrote:

> c9f01245 (oom: remove oom_disable_count) has removed oom_disable_count
> counter which has been used for early break out from oom_badness so we
> could never select a task with oom_score_adj set to OOM_SCORE_ADJ_MIN
> (oom disabled).
>
> Now that the counter is gone we are always going through heuristics
> calculation and we always return a non zero positive value.  This
> means that we can end up killing a task with OOM disabled because it is
> indistinguishable from regular tasks with 1% resp. CAP_SYS_ADMIN tasks
> with 3% usage of memory or tasks with oom_score_adj set but OOM enabled.
>
> Let's break out early if the task should have OOM disabled.
>
> Signed-off-by: Michal Hocko <mhocko@suse.cz>
> Acked-by: David Rientjes <rientjes@google.com>
> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
>  mm/oom_kill.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index e916168..4465fb8 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -185,6 +185,11 @@ unsigned int oom_badness(struct task_struct *p,
> struct mem_cgroup *mem,
>         if (!p)
>                return 0;
>
> +       if (p->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) {
> +               task_unlock(p);
> +               return 0;
> +       }
> +
>        /*
>         * The memory controller may have a limit of 0 bytes, so avoid a
> divide
>         * by zero, if necessary.
>


This might be late, but still:

Acked-by: Ying Han <yinghan@google.com>

Thanks for fixing this up.

--Ying

> --
> 1.7.7.1
>
>

[-- Attachment #2: Type: text/html, Size: 2855 bytes --]

      reply	other threads:[~2011-11-09 18:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-04 11:59 [PATCH resend] oom: do not kill tasks with oom_score_adj OOM_SCORE_ADJ_MIN Michal Hocko
2011-11-09 18:24 ` Ying Han [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='CALWz4ixzXXueAn_hMKiC-BRc-cRbFkmCbDgy=VJjsuXRZD_qDg@mail.gmail.com' \
    --to=yinghan@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=oleg@redhat.com \
    --cc=rientjes@google.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;
as well as URLs for NNTP newsgroup(s).