lkml.org 
[lkml]   [2010]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/14] freezer: fix a race during freezing of TASK_STOPPED tasks
On 11/26/2010 08:40 PM, Rafael J. Wysocki wrote:
> On Friday, November 26, 2010, Tejun Heo wrote:
>> After calling freeze_task(), try_to_freeze_tasks() see whether the
>> task is stopped or traced and if so, considers it to be frozen;
>> however, nothing guarantees that either the task being frozen sees
>> TIF_FREEZE or the freezer sees TASK_STOPPED -> TASK_RUNNING
>> transition. The task being frozen may wake up and not see TIF_FREEZE
>> while the freezer fails to notice the transition and believes the task
>> is still stopped.
>>
>> This patch fixes the race by making freeze_task() always go through
>> fake_signal_wake_up() for applicable tasks. The function goes through
>> the target task's scheduler lock and thus guarantees that either the
>> target sees TIF_FREEZE or try_to_freeze_task() sees TASK_RUNNING.
>
> Looks good. I'll take this one to my tree, if you don't mind.

Sure thing.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2010-11-26 21:01    [W:0.477 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site