[lkml]   [2010]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 3/9] oom: oom_kill_process() doesn't select kthread child
On Wed, Jun 16, 2010 at 08:32:08PM +0900, KOSAKI Motohiro wrote:
> Now, select_bad_process() have PF_KTHREAD check, but oom_kill_process
> doesn't. It mean oom_kill_process() may choose wrong task, especially,
> when the child are using use_mm().
Now oom_kill_process is called by three place.

1. mem_cgroup_out_of_memory
2. out_of_memory with sysctl_oom_kill_allocating_task
3. out_of_memory with non-sysctl_oom_kill_allocating_task

I think it's no problem in 1 and 3 since select_bad_process already checks
PF_KTHREAD. The problem in in 2.
So How about put the check before calling oom_kill_process in case of
sysctl_oom_kill_allocating task?

if (sysctl_oom_kill_allocating_task) {
if (!current->flags & PF_KTHREAD)

It can remove duplicated PF_KTHREAD check in select_bad_process and

Kind regards,
Minchan Kim

 \ /
  Last update: 2010-06-16 17:05    [W:0.130 / U:19.876 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site