linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Minchan Kim <minchan.kim@gmail.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Hugh Dickins <hughd@google.com>, Izik Eidus <ieidus@redhat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-mm@kvack.org
Subject: Re: [patch v2] oom: replace PF_OOM_ORIGIN with toggling oom_score_adj
Date: Thu, 14 Apr 2011 10:09:17 +0900	[thread overview]
Message-ID: <BANLkTikx12d+vBpc6esRDYSaFr1dH+9HMA@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1104131740280.16515@chino.kir.corp.google.com>

On Thu, Apr 14, 2011 at 9:41 AM, David Rientjes <rientjes@google.com> wrote:
> There's a kernel-wide shortage of per-process flags, so it's always
> helpful to trim one when possible without incurring a significant
> penalty.  It's even more important when you're planning on adding a per-
> process flag yourself, which I plan to do shortly for transparent
> hugepages.
>
> PF_OOM_ORIGIN is used by ksm and swapoff to prefer current since it has a
> tendency to allocate large amounts of memory and should be preferred for
> killing over other tasks.  We'd rather immediately kill the task making
> the errant syscall rather than penalizing an innocent task.
>
> This patch removes PF_OOM_ORIGIN since its behavior is equivalent to
> setting the process's oom_score_adj to OOM_SCORE_ADJ_MAX.
>
> The process's old oom_score_adj is stored and then set to
> OOM_SCORE_ADJ_MAX during the time it used to have PF_OOM_ORIGIN.  The old
> value is then reinstated when the process should no longer be considered
> a high priority for oom killing.
>
> Signed-off-by: David Rientjes <rientjes@google.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>

Seem to be reasonable and code don't have a problem.
But couldn't we make the function in general(ex, passed task_struct)
and use it when we change oom_score_adj(ex, oom_score_adj_write)?

-- 
Kind regards,
Minchan Kim

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2011-04-14  1:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-13 18:33 [patch] oom: replace PF_OOM_ORIGIN with toggling oom_score_adj David Rientjes
2011-04-14  0:03 ` KOSAKI Motohiro
2011-04-14  0:41   ` [patch v2] " David Rientjes
2011-04-14  0:46     ` KOSAKI Motohiro
2011-04-14  1:09     ` Minchan Kim [this message]
2011-04-14  1:12       ` David Rientjes
2011-04-14  1:21         ` Minchan Kim
2011-04-14  7:55           ` Matt Fleming
2011-04-14 20:18     ` [patch v3] " David Rientjes
2011-04-15 22:35       ` Hugh Dickins
2011-04-15 23:03         ` David Rientjes
2011-04-16  1:48           ` Hugh Dickins

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=BANLkTikx12d+vBpc6esRDYSaFr1dH+9HMA@mail.gmail.com \
    --to=minchan.kim@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=ieidus@redhat.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --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).