Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-09-11 Thread Stefano Stabellini
On Tue, 1 Aug 2017, Juergen Gross wrote: > +if (sock->sk == NULL) > +return 0; > + > +map = (struct sock_mapping *) READ_ONCE(sock->sk->sk_send_head); > +if (map == NULL) > +return 0; > + > +

Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-09-11 Thread Stefano Stabellini
On Tue, 1 Aug 2017, Juergen Gross wrote: > +if (sock->sk == NULL) > +return 0; > + > +map = (struct sock_mapping *) READ_ONCE(sock->sk->sk_send_head); > +if (map == NULL) > +return 0; > + > +

Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-08-01 Thread Boris Ostrovsky
>> BTW, I also noticed that in rcvmsg you are calling >> wait_event_interruptible() while holding the lock. Have you tested with >> CONFIG_DEBUG_ATOMIC_SLEEP? (or maybe it's some other config option that >> would complain about those sorts of thing) > I believe sleeping while holding a mutex is

Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-08-01 Thread Boris Ostrovsky
>> BTW, I also noticed that in rcvmsg you are calling >> wait_event_interruptible() while holding the lock. Have you tested with >> CONFIG_DEBUG_ATOMIC_SLEEP? (or maybe it's some other config option that >> would complain about those sorts of thing) > I believe sleeping while holding a mutex is

Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-08-01 Thread Juergen Gross
On 01/08/17 17:23, Boris Ostrovsky wrote: > On 07/31/2017 06:34 PM, Stefano Stabellini wrote: >> On Thu, 27 Jul 2017, Boris Ostrovsky wrote: +int pvcalls_front_release(struct socket *sock) +{ + struct pvcalls_bedata *bedata; + struct sock_mapping *map; + int req_id,

Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-08-01 Thread Juergen Gross
On 01/08/17 17:23, Boris Ostrovsky wrote: > On 07/31/2017 06:34 PM, Stefano Stabellini wrote: >> On Thu, 27 Jul 2017, Boris Ostrovsky wrote: +int pvcalls_front_release(struct socket *sock) +{ + struct pvcalls_bedata *bedata; + struct sock_mapping *map; + int req_id,

Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-08-01 Thread Boris Ostrovsky
On 07/31/2017 06:34 PM, Stefano Stabellini wrote: > On Thu, 27 Jul 2017, Boris Ostrovsky wrote: >>> +int pvcalls_front_release(struct socket *sock) >>> +{ >>> + struct pvcalls_bedata *bedata; >>> + struct sock_mapping *map; >>> + int req_id, notify; >>> + struct xen_pvcalls_request *req;

Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-08-01 Thread Boris Ostrovsky
On 07/31/2017 06:34 PM, Stefano Stabellini wrote: > On Thu, 27 Jul 2017, Boris Ostrovsky wrote: >>> +int pvcalls_front_release(struct socket *sock) >>> +{ >>> + struct pvcalls_bedata *bedata; >>> + struct sock_mapping *map; >>> + int req_id, notify; >>> + struct xen_pvcalls_request *req;

Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-07-31 Thread Stefano Stabellini
On Thu, 27 Jul 2017, Boris Ostrovsky wrote: > > +int pvcalls_front_release(struct socket *sock) > > +{ > > + struct pvcalls_bedata *bedata; > > + struct sock_mapping *map; > > + int req_id, notify; > > + struct xen_pvcalls_request *req; > > + > > + if (!pvcalls_front_dev) > > +

Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-07-31 Thread Stefano Stabellini
On Thu, 27 Jul 2017, Boris Ostrovsky wrote: > > +int pvcalls_front_release(struct socket *sock) > > +{ > > + struct pvcalls_bedata *bedata; > > + struct sock_mapping *map; > > + int req_id, notify; > > + struct xen_pvcalls_request *req; > > + > > + if (!pvcalls_front_dev) > > +

Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-07-27 Thread Boris Ostrovsky
> +int pvcalls_front_release(struct socket *sock) > +{ > + struct pvcalls_bedata *bedata; > + struct sock_mapping *map; > + int req_id, notify; > + struct xen_pvcalls_request *req; > + > + if (!pvcalls_front_dev) > + return -EIO; > + bedata =

Re: [PATCH v2 11/13] xen/pvcalls: implement release command

2017-07-27 Thread Boris Ostrovsky
> +int pvcalls_front_release(struct socket *sock) > +{ > + struct pvcalls_bedata *bedata; > + struct sock_mapping *map; > + int req_id, notify; > + struct xen_pvcalls_request *req; > + > + if (!pvcalls_front_dev) > + return -EIO; > + bedata =

[PATCH v2 11/13] xen/pvcalls: implement release command

2017-07-25 Thread Stefano Stabellini
Send PVCALLS_RELEASE to the backend and wait for a reply. Take both in_mutex and out_mutex to avoid concurrent accesses. Then, free the socket. Signed-off-by: Stefano Stabellini CC: boris.ostrov...@oracle.com CC: jgr...@suse.com --- drivers/xen/pvcalls-front.c | 85

[PATCH v2 11/13] xen/pvcalls: implement release command

2017-07-25 Thread Stefano Stabellini
Send PVCALLS_RELEASE to the backend and wait for a reply. Take both in_mutex and out_mutex to avoid concurrent accesses. Then, free the socket. Signed-off-by: Stefano Stabellini CC: boris.ostrov...@oracle.com CC: jgr...@suse.com --- drivers/xen/pvcalls-front.c | 85