dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/include
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 <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: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-08-18 16:31:13 -07:00
..
acpi Revert "ACPICA: Remove obsolete acpi_os_validate_address interface" 2009-07-27 18:42:38 -04:00
asm-generic mm: Pass virtual address to [__]p{te,ud,md}_free_tlb() 2009-07-27 12:10:38 -07:00
crypto
drm drm/radeon: Add support for RS880 chips 2009-08-05 12:07:09 +10:00
keys
linux mm: revert "oom: move oom_adj value" 2009-08-18 16:31:13 -07:00
math-emu
media V4L/DVB (12283): gspca - sn9c20x: New subdriver for sn9c201 and sn9c202 bridges. 2009-07-24 14:03:30 -03:00
mtd Kill jffs2-user.h 2009-06-05 17:31:38 +01:00
net net: restore gnet_stats_basic to previous definition 2009-08-17 21:33:49 -07:00
pcmcia
rdma
rxrpc
scsi sd, sr: fix Driver 'sd' needs updating message 2009-06-21 12:01:27 -05:00
sound Merge branch 'topic/pcm-jiffies-check' into for-linus 2009-06-10 07:26:41 +02:00
trace perf_counter: Zero dead bytes from ftrace raw samples size alignment 2009-08-10 16:51:19 +02:00
video fbdev: s1d13xxxfb: add accelerated bitblt functions 2009-06-16 19:48:00 -07:00
xen
Kbuild [SCSI] FC Pass Thru support 2009-06-12 14:20:05 -05:00