lkml.org 
[lkml]   [2008]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: workqueue cpu affinity
On 06/11, Max Krasnyansky wrote:
>
> Oleg Nesterov wrote:
> >
> > Yes, it is easy to implement flush_work(struct work_struct *work) which
> > only waits for that work, so it can't hang unless it was enqueued on the
> > isolated cpu.
> >
> > But in most cases it is enough to just do
> >
> > if (cancel_work_sync(work))
> > work->func(work);
> Cool. That would work.
> btw Somehow I thought that you already implemented flush_work(). I do not see
> it 2.6.25 but I could've sworn that I saw a patch flying by. Must have been
> something else. Do you mind adding that ?

Well... I don't think Andrew will take this patch right now... OK, I'll send
the preparation patch with comments. Do you see an immediate user for this
helper?

> > Or we can add flush_workqueue_cpus(struct workqueue_struct *wq, cpumask_t *cpu_map).
> That'd be special casing. I mean something will have to know what cpus cannot
> be flushed.

OK, we can make it flush_workqueue_except_isolated_cpus(struct workqueue_struct *wq).

> I liked your proposal above much better.

it was Peter who suggested this ;)

> > But I don't think we should change the behaviour of flush_workqueue().
> >
> >> This will require a bit of surgery across the entire tree. There is a lot of
> >> code that calls flush_scheduled_work()
> >
> > Almost all of them should be changed to use cancel_work_sync().
>
> That'd be a lot of changes.
>
> git grep flush_scheduled_work | wc
> 154 376 8674
>
> Hmm, I guess maybe not that bad. I might actually do that :-).

Cool! I _bet_ you will find a lot of bugs ;)

Oleg.



\
 
 \ /
  Last update: 2008-06-12 18:37    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site