Files
kernel-tenderloin-3.0/include/linux
KOSAKI Motohiro 28b83c5193 oom: move oom_adj value from task_struct to signal_struct
Currently, OOM logic callflow is here.

    __out_of_memory()
        select_bad_process()            for each task
            badness()                   calculate badness of one task
                oom_kill_process()      search child
                    oom_kill_task()     kill target task and mm shared tasks with it

example, process-A have two thread, thread-A and thread-B and it have very
fat memory and each thread have following oom_adj and oom_score.

     thread-A: oom_adj = OOM_DISABLE, oom_score = 0
     thread-B: oom_adj = 0,           oom_score = very-high

Then, select_bad_process() select thread-B, but oom_kill_task() refuse
kill the task because thread-A have OOM_DISABLE.  Thus __out_of_memory()
call select_bad_process() again.  but select_bad_process() select the same
task.  It mean kernel fall in livelock.

The fact is, select_bad_process() must select killable task.  otherwise
OOM logic go into livelock.

And root cause is, oom_adj shouldn't be per-thread value.  it should be
per-process value because OOM-killer kill a process, not thread.  Thus
This patch moves oomkilladj (now more appropriately named oom_adj) from
struct task_struct to struct signal_struct.  it naturally prevent
select_bad_process() choose wrong task.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Paul Menage <menage@google.com>
Cc: David Rientjes <rientjes@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-22 07:17:39 -07:00
..
2009-09-15 09:37:12 -07:00
2009-09-09 11:19:00 -04:00
2009-09-19 13:13:33 -07:00
2009-09-20 16:09:20 +05:30
2009-07-29 19:10:35 -07:00
2009-09-18 09:48:52 -07:00
2009-09-14 17:41:42 -07:00
2009-09-22 07:17:25 -07:00
2009-09-01 01:13:31 -07:00
2009-09-01 17:52:57 -07:00
2009-09-11 12:54:58 -07:00
2009-08-19 23:08:24 +04:00
2009-07-26 19:25:44 -07:00
2009-08-21 15:30:12 -07:00
2009-07-31 08:55:48 +02:00
2009-08-29 15:53:00 +02:00
2009-08-17 22:38:04 -04:00
2009-09-10 10:46:47 +03:00
2009-09-19 13:13:17 -07:00
2009-09-22 07:17:33 -07:00
2009-09-18 21:22:08 +02:00
2009-07-30 16:03:45 +09:30
2009-09-22 07:17:35 -07:00
2009-09-22 07:17:39 -07:00
2009-09-18 21:22:08 +02:00
2009-08-12 08:21:39 -07:00
2009-07-29 19:10:36 -07:00
2009-09-19 08:53:22 +02:00
2009-09-19 08:53:22 +02:00
2009-08-23 19:13:02 -07:00
2009-09-01 12:48:21 -04:00
2009-09-22 07:17:31 -07:00
2009-08-31 18:08:51 +02:00
2009-09-02 01:03:43 -07:00
2009-08-30 22:26:34 +02:00
2009-09-16 16:44:33 +02:00
2009-08-26 12:39:29 +01:00
2009-09-22 07:17:30 -07:00
2009-09-19 13:13:25 -07:00
2009-09-19 13:13:26 -07:00
2009-09-15 16:51:30 +02:00