Re: [patch v2 1/2] oom: avoid killing a task if a thread sharing its mm cannot be killed

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

 



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(&current->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>


[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]