On Mon, 31 May 2010, KOSAKI Motohiro wrote: > From: Oleg Nesterov <oleg@xxxxxxxxxx> > Subject: oom: select_bad_process: PF_EXITING check should take ->mm into account > > select_bad_process() checks PF_EXITING to detect the task which is going > to release its memory, but the logic is very wrong. > > - a single process P with the dead group leader disables > select_bad_process() completely, it will always return > ERR_PTR() while P can live forever > > - if the PF_EXITING task has already released its ->mm > it doesn't make sense to expect it is goiing to free > more memory (except task_struct/etc) > > Change the code to ignore the PF_EXITING tasks without ->mm. > > Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx> > Acked-by: David Rientjes <rientjes@xxxxxxxxxx> > Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> [rebase to latest -mm] This is already pushed in my oom killer rewrite as patch 13/18 "oom: avoid race for oom killed tasks detaching mm prior to exit". It's not vital to merge now because causing the oom killer to temporarily become a no-op before it can fully exit even though it has already detached its memory only delays killing another task until it exits and there's nothing in the way of that exiting while it's still under PF_EXITING. -- 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>