diff options
author | Oleg Nesterov <oleg@redhat.com> | 2010-08-09 20:18:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-09 23:44:55 -0400 |
commit | 455c0e5fb03b67fa62bd12e3abe3fa484b9960c5 (patch) | |
tree | 082cbecb8927e1c8e0c2cea5d5639e9c8f62eafe /mm/oom_kill.c | |
parent | a9877cc2937889e5669114f28612b494384152a4 (diff) |
oom: check PF_KTHREAD instead of !mm to skip kthreads
select_bad_process() thinks a kernel thread can't have ->mm != NULL, this
is not true due to use_mm().
Change the code to check PF_KTHREAD.
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r-- | mm/oom_kill.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 709aedfaa014..7c0dc414dba8 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -256,14 +256,11 @@ static struct task_struct *select_bad_process(unsigned long *ppoints, | |||
256 | for_each_process(p) { | 256 | for_each_process(p) { |
257 | unsigned long points; | 257 | unsigned long points; |
258 | 258 | ||
259 | /* | 259 | /* skip tasks that have already released their mm */ |
260 | * skip kernel threads and tasks which have already released | ||
261 | * their mm. | ||
262 | */ | ||
263 | if (!p->mm) | 260 | if (!p->mm) |
264 | continue; | 261 | continue; |
265 | /* skip the init task */ | 262 | /* skip the init task and kthreads */ |
266 | if (is_global_init(p)) | 263 | if (is_global_init(p) || (p->flags & PF_KTHREAD)) |
267 | continue; | 264 | continue; |
268 | if (mem && !task_in_mem_cgroup(p, mem)) | 265 | if (mem && !task_in_mem_cgroup(p, mem)) |
269 | continue; | 266 | continue; |