lkml.org 
[lkml]   [2010]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] oom: select_bad_process: PF_EXITING check should take ->mm into account
On Mon, 31 May 2010, KOSAKI Motohiro wrote:

> From: Oleg Nesterov <oleg@redhat.com>
> 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@redhat.com>
> Acked-by: David Rientjes <rientjes@google.com>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> [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.


\
 
 \ /
  Last update: 2010-06-01 22:41    [W:0.209 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site