On Wed, 18 Aug 2010, KAMEZAWA Hiroyuki wrote: > > Is it worth adding > > > > if (unlikely(current->signal->oom_score_adj == OOM_SCORE_ADJ_MIN)) > > atomic_dec(¤t->mm->oom_disable_count); > > > > to exit_mm() under task_lock() to avoid the O(n^2) select_bad_process() on > > oom? Or do you think that's too expensive? > > > > Hmm, if this coutner is changed only under down_write(mmap_sem), > simple 'int' counter is enough quick. > task->mm->oom_disable_count would be protected by task_lock(task) to pin the ->mm, which we already take in exit_mm() to set task->mm to NULL. We can take task_lock() in the proc handler, oom killer, and exec() paths where we're interested in the accounting. -- 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/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>