lkml.org 
[lkml]   [2014]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue
On Thu, Nov 20, 2014 at 11:49:33AM -0500, Tejun Heo wrote:
> On Thu, Nov 20, 2014 at 06:47:11PM +0200, Michael S. Tsirkin wrote:
> > > There's cancel_work_sync() to stop the self-requeueing ones.
> >
> > What happens if queue_work runs while cancel_work_sync is in progress?
> > Does it fail to queue?
>
> cancel_work_sync() is guaranteed to take self-requeueing work items no
> matter when it's called or what's going on. External (non-self)
> queueings of course should be stopped in other ways.

Excellent, thanks a lot.

> > > > From that POV a dedicated WQ kept it simple.
> > >
> > > A dedicated wq doesn't do anything for that. You can't shut down a
> > > workqueue with a pending work item on it. destroy_workqueue() will
> > > try to drain the target wq, warn if it doesn't finish in certain
> > > number of iterations and just keep trying indefinitely.
> > >
> > > Thanks.
> >
> > Right, so eventually we'll stop requeueuing and it will succeed?
>
> Yeah, sure, it's a silly reason to use a separate workqueue tho.
> Don't do it that way.
>
> Thanks.

Since there's cancel_work_sync I agree.

> --
> tejun


\
 
 \ /
  Last update: 2014-11-20 18:21    [W:0.032 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site