lkml.org 
[lkml]   [2011]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] thp: reduce khugepaged freezing latency
Hello,

On Wed, Nov 09, 2011 at 08:59:25AM -0800, Tejun Heo wrote:
> Freezer depends on the usual "set_current_state(INTERRUPTIBLE); check
> freezing; schedule(); check freezing" construct and sends
> INTERRUPTIBLE wake up after setting freezing state. The
> synchronization hasn't been completely clear but recently been cleaned
> up, so as long as freezing condition is tested after INTERRUPTIBLE is
> set before going to sleep, the event won't go missing.
>
> Maybe we need a helper here, which would be named horribly -
> schedule_timeout_interruptible_freezable(). (cc'ing Oleg) Oleg, maybe
> we need schedule_timeout(@sleep_type) too?

Ah, crap, still waking up. Sorry about that. So, yes, there's a race
condition above. You need to set TASK_INTERRUPTIBLE before testing
freezing and use schedule_timeout() instead of
schedule_timeout_interruptible(). Was getting confused with
prepare_to_wait(). That said, why not use prepare_to_wait() instead?

Thanks.

--
tejun


\
 
 \ /
  Last update: 2011-11-09 18:09    [W:0.098 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site