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-12 11:51:14 +01:00
2009-09-04 02:16:14 -07:00
2009-08-07 10:39:56 -07:00
2009-09-19 00:51:34 -03:00
2009-09-17 09:47:22 +02:00
2009-08-27 22:05:39 -07:00
2009-07-25 20:16:01 +02:00
2009-09-22 07:17:25 -07:00
2009-09-18 09:47:25 -07:00
2009-07-26 19:25:47 -07:00
2009-09-15 09:37:12 -07:00
2009-08-25 16:07:58 +02:00
2009-08-24 14:56:30 +02:00
2009-08-24 14:56:30 +02:00
2009-08-24 14:56:30 +02:00
2009-08-24 14:56:30 +02:00
2009-09-17 09:47:05 +02:00
2009-09-09 11:19:00 -04:00
2009-08-20 18:20:25 -04:00
2009-09-19 13:13:33 -07:00
2009-08-03 09:04:57 +01:00
2009-09-20 16:09:20 +05:30
2009-09-01 01:14:07 -07:00
2009-09-01 19:47:20 -04:00
2009-09-15 09:50:47 -07:00
2009-09-16 15:18:52 +02:00
2009-09-05 11:30:42 -07:00
2009-09-11 14:33:31 +02:00
2009-08-21 09:26:15 -07:00
2009-09-11 14:33:32 +02:00
2009-09-14 08:24:53 +02:00
2009-09-22 07:17:38 -07:00
2009-07-31 12:28:46 +02:00
2009-07-29 19:10:35 -07:00
2009-08-28 20:25:24 +02:00
2009-08-15 19:02:07 +02:00
2009-09-01 12:45:14 -04:00
2009-08-21 09:26:15 -07:00
2009-09-14 12:34:07 +10:00
2009-09-19 13:13:31 -07:00
2009-09-01 01:24:30 -07:00
2009-09-18 09:48:52 -07:00
2009-09-04 20:40:25 +01:00
2009-09-19 12:50:38 -07:00
2009-09-04 20:40:34 +01:00
2009-08-28 14:24:10 +10:00
2009-09-08 21:17:48 -04:00
2009-09-14 17:41:42 -07:00
2009-08-22 17:52:13 -05:00
2009-09-02 23:07:39 -07:00
2009-08-26 20:06:52 -07:00
2009-09-22 07:17:25 -07:00
2009-09-18 07:25:44 +02:00
2009-09-20 16:58:35 +05:30
2009-08-17 21:33:49 -07:00
2009-09-22 07:17:25 -07:00
2009-09-22 07:17:38 -07:00
2009-08-25 13:44:04 +01:00
2009-09-11 13:23:18 -07:00
2009-09-19 13:13:31 -07:00
2009-09-01 01:13:31 -07:00
2009-09-13 20:09:41 +02:00
2009-08-14 15:59:30 +02:00
2009-09-22 07:17:26 -07:00
2009-09-19 00:16:14 -03:00
2009-08-12 22:13:15 -07:00
2009-09-01 17:52:57 -07:00
2009-08-28 14:40:24 -04: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-09-07 01:56:33 -07:00
2009-09-15 02:37:40 -07:00
2009-07-27 18:39:45 -07:00
2009-09-21 14:28:04 +02:00
2009-08-21 15:30:12 -07:00
2009-09-14 17:55:15 -07:00
2009-08-26 15:41:16 -07:00
2009-07-31 08:55:48 +02:00
2009-09-11 13:21:31 -07:00
2009-08-29 15:53:00 +02:00
2009-08-17 22:38:04 -04:00
2009-09-16 17:44:10 +02:00
2009-09-10 10:46:47 +03:00
2009-09-02 21:29:22 +10:00
2009-09-02 21:29:22 +10:00
2009-09-19 13:13:17 -07:00
2009-09-04 16:05:55 +01:00
2009-08-27 14:29:16 +01:00
2009-09-15 23:51:31 -04:00
2009-09-22 07:17:33 -07:00
2009-09-18 21:22:08 +02:00
2009-09-10 08:33:20 +03:00
2009-09-10 08:33:16 +03:00
2009-07-30 16:03:45 +09:30
2009-07-30 16:03:46 +09:30
2009-09-01 19:47:20 -04:00
2009-08-19 21:46:09 -07:00
2009-08-31 17:30:14 -10:00
2009-08-02 15:41:37 +02:00
2009-08-17 08:37:18 +10:00
2009-08-18 20:13:03 -07:00
2009-09-22 07:17:35 -07:00
2009-09-19 12:50:38 -07:00
2009-07-25 20:18:16 +02:00
2009-07-25 20:19:25 +02:00
2009-09-22 07:17:37 -07:00
2009-08-18 16:31:13 -07:00
2009-09-22 07:17:38 -07:00
2009-09-22 07:17:31 -07:00
2009-09-22 07:17:39 -07:00
2009-09-18 21:22:08 +02:00
2009-09-15 02:39:20 -07:00
2009-09-17 20:53:52 -07:00
2009-09-14 17:02:50 -07:00
2009-09-08 19:50:03 -04:00
2009-08-09 15:06:19 -04:00
2009-08-12 08:21:39 -07:00
2009-08-14 09:13:43 -04:00
2009-08-19 23:08:22 +04:00
2009-08-03 09:56:52 +02:00
2009-08-07 10:39:55 -07:00
2009-09-15 02:37:40 -07:00
2009-09-22 07:17:38 -07:00
2009-09-20 16:57:50 +05:30
2009-09-22 07:17:38 -07:00
2009-08-22 13:07:09 +02:00
2009-09-14 17:39:12 -07:00
2009-09-17 16:47:06 -04:00
2009-09-15 09:50:48 -07:00
2009-09-09 14:19:11 -07:00
2009-09-15 09:39:44 -07:00
2009-08-14 15:00:53 +09:00
2009-09-21 14:34:11 +02:00
2009-09-21 14:34:11 +02:00
2009-09-11 12:55:10 -07:00
2009-08-23 00:04:44 +02:00
2009-09-14 20:27:00 +02:00
2009-07-29 19:10:36 -07:00
2009-09-21 14:28:04 +02:00
2009-09-22 07:17:24 -07:00
2009-09-19 08:53:22 +02: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-04 19:42:22 -04:00
2009-09-22 07:17:31 -07:00
2009-09-09 03:42:23 -07:00
2009-09-15 02:44:17 -07:00
2009-07-31 12:28:45 +02:00
2009-09-22 07:17:39 -07:00
2009-09-10 10:11:24 +10:00
2009-09-15 11:37:33 +10:00
2009-09-19 13:13:19 -07:00
2009-09-19 13:13:32 -07:00
2009-09-19 13:13:30 -07:00
2009-07-26 11:17:01 -07:00
2009-08-24 19:52:38 +09:00
2009-09-15 09:50:49 -07:00
2009-07-24 15:05:31 -04:00
2009-08-06 11:36:25 +03:00
2009-09-14 20:19:06 +03:00
2009-08-31 18:08:51 +02:00
2009-08-31 18:08:51 +02:00
2009-09-22 07:17:25 -07:00
2009-07-28 14:19:20 +09:00
2009-09-21 09:15:07 -07:00
2009-09-18 09:48:52 -07:00
2009-09-01 18:25:07 -07:00
2009-09-02 01:03:43 -07:00
2009-09-15 10:17:30 +02:00
2009-08-30 22:26:34 +02:00
2009-09-16 16:44:33 +02:00
2009-08-26 08:29:02 +02:00
2009-09-15 09:50:47 -07:00
2009-08-04 13:46:30 -07:00
2009-09-19 13:13:35 -07:00
2009-08-21 00:53:12 -07:00
2009-07-29 19:10:39 -07:00
2009-09-19 12:50:38 -07:00
2009-08-26 12:39:29 +01:00
2009-09-09 13:29:41 -07:00
2009-09-19 00:18:36 -03:00
2009-07-30 16:03:46 +09:30
2009-07-30 16:03:46 +09:30
2009-07-30 16:03:46 +09:30
2009-07-30 16:03:46 +09:30
2009-08-14 15:00:52 +09: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
2009-09-05 11:30:42 -07:00
2009-09-16 15:18:52 +02:00
2009-09-10 10:11:22 +10:00