lkml.org 
[lkml]   [2009]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2.6.32-rc6] workqueue: fix race condition in schedule_on_each_cpu()
Hello, Oleg.

11/14/2009 12:38 AM, Oleg Nesterov wrote:
> A very minor nit, schedule_on_each_cpu() still checks "orig" twice,
> perhaps it makes sense to do
>
> for_each_online_cpu(cpu) {
> struct work_struct *work = per_cpu_ptr(works, cpu);
>
> INIT_WORK(work, func);
>
> if (likely(cpu != orig))
> schedule_work_on(cpu, work);
> else
> func(work);
> }

The intention was to schedule works on all other cpus first and then
execute it on local cpu so that if it takes some time, it doesn't have
to go through the latency twice.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2009-11-14 10:05    [W:0.057 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site