Messages in this thread | | | Date | Wed, 25 Sep 2013 14:05:02 -0700 (PDT) | From | David Rientjes <> | Subject | Re: [PATCH v3] kthread: Make kthread_create() killable. |
| |
On Wed, 25 Sep 2013, Tetsuo Handa wrote:
> Any users of wait_for_completion() might be chosen by the OOM killer while > waiting for completion() call by some process which does memory > allocation. kthread_create() is one of such users. >
Any user process callers of wait_for_completion() you mean.
> When such users are chosen by the OOM killer when they are waiting for > completion() in TASK_UNINTERRUPTIBLE, the system will be kept stressed > due to memory starvation because the OOM killer cannot kill such users. >
Also results in a livelock if you're running in a memcg and have hit its limit.
> Fix this problem for kthreadd by making kthread_create() killable. >
There appear to be other potential callers of wait_for_completion() in the tree as well that could be holding lots of memory besides kthread_create().
Perhaps that's beyond the scope of this particular patch, though.
wait_for_completion() is scary if that completion requires memory that cannot be allocated because the caller is killed but uninterruptible.
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> > Cc: Oleg Nesterov <oleg@redhat.com> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Rientjes <rientjes@google.com>
| |