lkml.org 
[lkml]   [2010]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] scheduler: replace migration_thread with cpu_stop
Hello,

On 05/03/2010 03:26 PM, Peter Zijlstra wrote:
> On Thu, 2010-04-22 at 18:09 +0200, Tejun Heo wrote:
>> @@ -2909,7 +2912,9 @@ redo:
>> }
>> raw_spin_unlock_irqrestore(&busiest->lock, flags);
>> if (active_balance)
>> - wake_up_process(busiest->migration_thread);
>> + stop_one_cpu_nowait(cpu_of(busiest),
>> + active_load_balance_cpu_stop, busiest,
>> + &busiest->active_balance_work);
>
> So who guarantees busiest->active_balance_work isn't already enqueued by
> some other cpu's load-balancer run?
>

Hmmm... maybe I'm mistaken but isn't that guaranteed by
busiest->active_balance which is protected by the rq lock?
active_load_balance_cpu_stop is scheduled iff busiest->active_balance
was changed from zero and only active_load_balance_cpu_stop() can
clear it at the end of its execution at which point the
active_balance_work is safe to reuse.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2010-05-04 09:21    [W:0.084 / U:1.172 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site