lkml.org 
[lkml]   [2014]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch] freezer: check OOM kill signal while being frozen
On Fri, 8 Aug 2014, Cong Wang wrote:

> diff --git a/kernel/freezer.c b/kernel/freezer.c
> index aa6a8aa..c6d189d 100644
> --- a/kernel/freezer.c
> +++ b/kernel/freezer.c
> @@ -68,7 +68,9 @@ bool __refrigerator(bool check_kthr_stop)
> spin_lock_irq(&freezer_lock);
> current->flags |= PF_FROZEN;
> if (!freezing(current) ||
> - (check_kthr_stop && kthread_should_stop()))
> + (check_kthr_stop && kthread_should_stop()) ||
> + (test_tsk_thread_flag(current, TIF_MEMDIE) &&
> + fatal_signal_pending(current)))
> current->flags &= ~PF_FROZEN;
> spin_unlock_irq(&freezer_lock);
>

All threads with TIF_MEMDIE set would have been killed, why is the check
for fatal_signal_pending(current) needed?

You can also use test_thread_flag(TIF_MEMDIE) instead since you're only
concerned with current.

Furthermore, that conditional is getting difficult to read. Maybe it
would help to have a helper function that returns bool that determines
whether PF_FROZEN should be cleared?


\
 
 \ /
  Last update: 2014-08-09 11:01    [W:0.079 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site