Files
linux/Documentation
KOSAKI Motohiro 0753ba01e1 mm: revert "oom: move oom_adj value"
The commit 2ff05b2b (oom: move oom_adj value) moveed the oom_adj value to
the mm_struct.  It was a very good first step for sanitize OOM.

However Paul Menage reported the commit makes regression to his job
scheduler.  Current OOM logic can kill OOM_DISABLED process.

Why? His program has the code of similar to the following.

	...
	set_oom_adj(OOM_DISABLE); /* The job scheduler never killed by oom */
	...
	if (vfork() == 0) {
		set_oom_adj(0); /* Invoked child can be killed */
		execve("foo-bar-cmd");
	}
	....

vfork() parent and child are shared the same mm_struct.  then above
set_oom_adj(0) doesn't only change oom_adj for vfork() child, it's also
change oom_adj for vfork() parent.  Then, vfork() parent (job scheduler)
lost OOM immune and it was killed.

Actually, fork-setting-exec idiom is very frequently used in userland program.
We must not break this assumption.

Then, this patch revert commit 2ff05b2b and related commit.

Reverted commit list
---------------------
- commit 2ff05b2b4e (oom: move oom_adj value from task_struct to mm_struct)
- commit 4d8b9135c3 (oom: avoid unnecessary mm locking and scanning for OOM_DISABLE)
- commit 8123681022 (oom: only oom kill exiting tasks with attached memory)
- commit 933b787b57 (mm: copy over oom_adj value at fork time)

Signed-off-by: KOSAKI Motohiro <[email protected]>
Cc: Paul Menage <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: KAMEZAWA Hiroyuki <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Nick Piggin <[email protected]>
Cc: Mel Gorman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2009-08-18 16:31:13 -07:00
..
2009-08-01 10:24:35 +02:00
…
2008-10-30 11:38:45 -07:00
2009-04-07 08:12:38 +02:00
…
2009-06-22 10:12:35 +01:00
2009-07-30 13:10:50 -07:00
2009-06-16 19:47:58 -07:00
…
…
2009-03-30 15:21:59 +02:00
2009-06-11 01:58:01 -07:00
2009-06-20 01:10:38 -07:00
…
…
2009-06-16 14:30:14 -07:00
2008-10-30 11:38:45 -07:00
2009-06-18 13:04:04 -07:00
2009-06-30 18:56:00 -07:00
…
2008-12-03 16:09:53 -07:00
2008-11-12 17:17:18 -08:00
2008-11-14 10:39:26 +11:00
2009-03-26 15:45:43 -07:00
…
2009-06-30 18:55:59 -07:00
…
…
…
…
…
…
…
2009-04-27 12:00:27 -07:00
2009-04-27 12:00:27 -07:00
…
…
2009-03-31 15:18:37 +11:00
…
…
2008-11-12 17:17:17 -08:00
…
…
2009-04-14 09:00:23 +10:00
…
…