lkml.org 
[lkml]   [2014]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [Patch v3 1/2] freezer: check OOM kill while being frozen
From
On Sat, Aug 16, 2014 at 5:20 AM, Tejun Heo <tj@kernel.org> wrote:
> On Thu, Aug 14, 2014 at 02:15:25PM -0700, Cong Wang wrote:
>> +static bool should_thaw_current(bool check_kthr_stop)
>> +{
>> + if (!freezing(current) ||
>> + (check_kthr_stop && kthread_should_stop()) ||
>> + test_thread_flag(TIF_MEMDIE))
>> + return true;
>> + else
>> + return false;
>> +}
>
> I'm not sure this is safe w.r.t. hibernation. Please cc Rafael on
> freezer related changes.

Or we can just check for cgroup freeze, something like below:

diff --git a/kernel/freezer.c b/kernel/freezer.c
index 33cbcb0..b06a059 100644
--- a/kernel/freezer.c
+++ b/kernel/freezer.c
@@ -56,7 +56,8 @@ static bool should_thaw_current(bool check_kthr_stop)
{
if (!freezing(current) ||
(check_kthr_stop && kthread_should_stop()) ||
- test_thread_flag(TIF_MEMDIE))
+ /* It might not be safe to check TIF_MEMDIE for pm freeze */
+ (cgroup_freezing(current) && test_thread_flag(TIF_MEMDIE)))
return true;
else
return false;

Are you happy now, Tejun? :)


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