Re: [Xen-devel] [PATCH v4 13/18] xen/pvcalls: implement release command

2017-06-21 Thread Stefano Stabellini
On Tue, 20 Jun 2017, Boris Ostrovsky wrote: > > + > > +static int pvcalls_back_release_passive(struct xenbus_device *dev, > > + struct pvcalls_fedata *fedata, > > + struct sockpass_mapping *mappass) > > +{ > > + if (mappass->sock

Re: [Xen-devel] [PATCH v4 13/18] xen/pvcalls: implement release command

2017-06-20 Thread Boris Ostrovsky
> + > +static int pvcalls_back_release_passive(struct xenbus_device *dev, > + struct pvcalls_fedata *fedata, > + struct sockpass_mapping *mappass) > +{ > + if (mappass->sock->sk != NULL) { > + write_lock_bh(&ma

[Xen-devel] [PATCH v4 13/18] xen/pvcalls: implement release command

2017-06-15 Thread Stefano Stabellini
Release both active and passive sockets. For active sockets, make sure to avoid possible conflicts with the ioworker reading/writing to those sockets concurrently. Set map->release to let the ioworker know atomically that the socket will be released soon, then wait until the ioworker finishes (flus