Messages in this thread | | | Date | Wed, 14 Dec 2011 15:54:12 -0800 | From | Tejun Heo <> | Subject | Re: [PATCH RFC] virtio_net: fix refill related races |
| |
Hello, Rusty.
On Tue, Dec 13, 2011 at 01:05:11PM +1030, Rusty Russell wrote: > Both places where we call: > > cancel_delayed_work_sync(&vi->refill); > > Do not actually guarantee that vi->refill isn't running, because it > can requeue itself. A 'bool no_more_refill' field seems like the > simplest fix for this, but I don't think it's sufficient. > > Tejun, is this correct? What's the correct way to synchronously stop a > delayed_work which can "schedule_delayed_work(&vi->refill, HZ/2);" on > itself?
cancel_delayed_work_sync() itself should be good enough. It first steals the pending state and then waits for it to finish if in-flight. Queueing itself afterwards becomes noop.
Thanks.
-- tejun
| |