[PATCH 3/3] oom: select_bad_process: use same_thread_group()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



select_bad_process() checks if the exiting process is current. This
condition can never be true if the caller is not the main thread.
Use same_thread_group() instead.

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
---

 mm/oom_kill.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 38/mm/oom_kill.c~fix_ck_current	2011-03-12 14:22:19.000000000 +0100
+++ 38/mm/oom_kill.c	2011-03-12 14:27:14.000000000 +0100
@@ -341,7 +341,7 @@ static struct task_struct *select_bad_pr
 		 * Otherwise we could get an easy OOM deadlock.
 		 */
 		if (mm_is_exiting(p)) {
-			if (p != current)
+			if (!same_thread_group(p, current))
 				return ERR_PTR(-1UL);
 
 			chosen = p;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]