mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Paul Menage <menage@google.com>,
	kosaki.motohiro@jp.fujitsu.com, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, rientjes@google.com, mel@csn.ul.ie,
	npiggin@suse.de
Subject: [PATCH -mm] copy over oom_adj value at fork time (v2)
Date: Tue, 14 Jul 2009 22:12:35 -0400	[thread overview]
Message-ID: <20090714221235.4a2383ea@bree.surriel.com> (raw)
In-Reply-To: <20090715104920.39A4.A69D9226@jp.fujitsu.com>

After moving the oom_adj value from the task struct to the
mm_struct, the oom_adj value was no longer properly inherited
by child processes.

Copying over the oom_adj value at fork time fixes that bug.

Signed-off-by: Rik van Riel <riel@redhat.com>
Reported-by: Paul Menage <manage@google.com>
---
v2: test for current->mm before dereferencing it (Kosaki Motohiro)

 kernel/fork.c |    1 +
 1 file changed, 1 insertion(+)

Index: mmotm/kernel/fork.c
===================================================================
--- mmotm.orig/kernel/fork.c	2009-07-14 20:58:01.000000000 -0400
+++ mmotm/kernel/fork.c	2009-07-14 22:09:23.000000000 -0400
@@ -435,6 +435,7 @@ static struct mm_struct * mm_init(struct
 	init_rwsem(&mm->mmap_sem);
 	INIT_LIST_HEAD(&mm->mmlist);
 	mm->flags = (current->mm) ? current->mm->flags : default_dump_filter;
+	mm->oom_adj = (current->mm) ? current->mm->oom_adj : 0;
 	mm->core_state = NULL;
 	mm->nr_ptes = 0;
 	set_mm_counter(mm, file_rss, 0);


  reply	other threads:[~2009-07-15  2:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200906020557.n525v6KO004302@imap1.linux-foundation.org>
2009-07-15  0:52 ` + oom-move-oom_adj-value-from-task_struct-to-mm_struct.patch added to -mm tree Paul Menage
2009-07-15  1:05   ` [PATCH] copy over oom_adj value at fork time Rik van Riel
2009-07-15  1:15     ` Paul Menage
2009-07-15  2:01       ` KOSAKI Motohiro
2009-07-15  2:12         ` Rik van Riel [this message]
2009-07-15  3:42           ` [PATCH -mm] copy over oom_adj value at fork time (v2) David Rientjes
2009-07-15  3:48       ` [PATCH] copy over oom_adj value at fork time David Rientjes
2009-07-16 23:29       ` Paul Menage
2009-07-17  9:34         ` David Rientjes
2009-07-17 20:03           ` Paul Menage
2009-07-17 23:12             ` David Rientjes
2009-07-20 21:52               ` Paul Menage
2009-07-21  3:40                 ` David Rientjes
2009-07-21  7:19                 ` KOSAKI Motohiro
2009-07-21 16:06                   ` Paul Menage
2009-07-21 19:54                     ` David Rientjes
2009-07-21 19:57                       ` Paul Menage
2009-07-21 20:00                         ` David Rientjes
2009-07-21 20:03                           ` Paul Menage
2009-07-23 23:21                             ` KOSAKI Motohiro
2009-07-23 23:29                               ` David Rientjes
2009-07-24  1:10                                 ` KOSAKI Motohiro
2009-07-24  9:27                                   ` David Rientjes
2009-07-28  6:09                                     ` KOSAKI Motohiro
2009-07-28  6:14                                       ` David Rientjes
2009-07-15  1:49     ` KOSAKI Motohiro

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=20090714221235.4a2383ea@bree.surriel.com \
    --to=riel@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mel@csn.ul.ie \
    --cc=menage@google.com \
    --cc=npiggin@suse.de \
    --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

all inboxes | Powered by JetHome®