lkml.org 
[lkml]   [2011]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH RFC] virtio_net: fix refill related races
    On Tue, Dec 13, 2011 at 01:05:11PM +1030, Rusty Russell wrote:
    > On Mon, 12 Dec 2011 13:54:06 +0200, "Michael S. Tsirkin" <mst@redhat.com> wrote:
    > > On Mon, Dec 12, 2011 at 09:25:07AM +1030, Rusty Russell wrote:
    > > > Orthogonally, the refill-stop code is still buggy, as you noted.
    > >
    > > Sorry I don't understand how it's still buggy.
    >
    > 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?
    >
    > Thanks,
    > Rusty.

    Another question, wanted to make sure:
    virtnet_poll does schedule_delayed_work(&vi->refill, 0);
    separately refill work itself also does
    schedule_delayed_work(&vi->refill, HZ/2);
    If two such events happen twice, on different CPUs, we are still guaranteed
    the work will only run once, right?



    \
     
     \ /
      Last update: 2011-12-20 20:09    [W:0.020 / U:32.480 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site