Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1532243

Re: [Xen-devel] [PATCH] xen/scsifront: don't advance ring request pointer in case of error

From Juergen Gross <jgross@suse.com>
Newsgroups linux.kernel
Subject Re: [Xen-devel] [PATCH] xen/scsifront: don't advance ring request pointer in case of error
Date 2016-11-29 13:40 +0100
Message-ID <sIPRw-8uh-21@gated-at.bofh.it> (permalink)
References <sHwee-5RF-11@gated-at.bofh.it> <sIOiJ-7oC-15@gated-at.bofh.it> <sIOC6-7Kl-33@gated-at.bofh.it> <sIOC6-7Kl-31@gated-at.bofh.it> <sIPRw-8uh-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 29/11/16 12:40, Jan Beulich wrote:
>>>> On 29.11.16 at 12:19, <JGross@suse.com> wrote:
>> On 29/11/16 12:14, Jan Beulich wrote:
>>>>>> On 29.11.16 at 11:50, <JGross@suse.com> wrote:
>>>> --- a/drivers/scsi/xen-scsifront.c
>>>> +++ b/drivers/scsi/xen-scsifront.c
>>>> @@ -184,8 +184,6 @@ static struct vscsiif_request *scsifront_pre_req(struct 
>> vscsifrnt_info *info)
>>>>  
>>>>  	ring_req = RING_GET_REQUEST(&(info->ring), ring->req_prod_pvt);
>>>>  
>>>> -	ring->req_prod_pvt++;
>>>
>>> Please note the "_pvt" suffix, which stands for "private": This field is
>>> not visible to the backend. Only ring->sring fields are shared, and
>>> the updating of the shared field happens in RING_PUSH_REQUESTS()
>>> and RING_PUSH_REQUESTS_AND_CHECK_NOTIFY().
>>
>> Sure, but RING_PUSH_REQUESTS() will copy req_prod_pvt to req_prod. In
>> the case corrected this would advance req_prod by two after the error
>> case before, even if only one request would have made it to the ring.
> 
> Okay, then I may have been mislead by the patch description: I
> understood it to say that you want to avoid the backend seeing
> requests which haven't been filled fully, but it looks like you're
> instead saying that for these requests the filling will never be
> completed (because of some unrelated(?) error). Iirc other
> frontend drivers behave similarly to the unpatched scsifront, and

blkfront and netfront seem to be okay.

> incrementing req_prod_pvt late has possible (perhaps just
> theoretical) other issues, like parallel retrieval and filling of them
> on mor than one CPU. Wouldn't it be better to obtain a request

In scsifront the complete critical path is guarded by a lock.

> structure only when everything else is ready (and hence no further
> errors can occur)? After all you also need to deal with the acquired
> ID upon errors, and seems odd to me to deal with the two parts of
> cleanup in different places (and even in different ways).

Hmm, I can see your point.

I'll have a look how intrusive such a change would be.


Juergen

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] xen-scsifront: Add a missing call to kfree Dan Carpenter <dan.carpenter@oracle.com> - 2016-11-25 22:30 +0100
  [PATCH] xen/scsifront: don't advance ring request pointer in case of error Juergen Gross <jgross@suse.com> - 2016-11-29 12:00 +0100
    Re: [Xen-devel] [PATCH] xen/scsifront: don't advance ring  request pointer in case of error "Jan Beulich" <JBeulich@suse.com> - 2016-11-29 12:20 +0100
    Re: [Xen-devel] [PATCH] xen/scsifront: don't advance ring request  pointer in case of error Juergen Gross <jgross@suse.com> - 2016-11-29 12:20 +0100
      Re: [Xen-devel] [PATCH] xen/scsifront: don't advance ring request  pointer in case of error David Vrabel <david.vrabel@citrix.com> - 2016-11-29 12:40 +0100
        Re: [Xen-devel] [PATCH] xen/scsifront: don't advance ring request  pointer in case of error Juergen Gross <jgross@suse.com> - 2016-11-29 12:40 +0100
      Re: [Xen-devel] [PATCH] xen/scsifront: don't advance ring  request pointer in case of error "Jan Beulich" <JBeulich@suse.com> - 2016-11-29 12:50 +0100
      Re: [Xen-devel] [PATCH] xen/scsifront: don't advance ring request  pointer in case of error Juergen Gross <jgross@suse.com> - 2016-11-29 13:40 +0100
  [PATCH v2] xen/scsifront: don't request a slot on the ring until request is ready Juergen Gross <jgross@suse.com> - 2016-12-02 07:20 +0100
  [PATCH v2] xen/scsifront: don't request a slot on the ring until request is ready Juergen Gross <jgross@suse.com> - 2016-12-02 07:20 +0100
  [PATCH v2] xen/scsifront: don't request a slot on the ring until request is ready Juergen Gross <jgross@suse.com> - 2016-12-02 07:20 +0100
    Re: [PATCH v2] xen/scsifront: don't request a slot on the ring until  request is ready Juergen Gross <jgross@suse.com> - 2016-12-05 16:40 +0100
    Re: [PATCH v2] xen/scsifront: don't request a slot on the ring until  request is ready Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-12-05 16:40 +0100
    Re: [PATCH v2] xen/scsifront: don't request a slot on the ring until  request is ready Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-12-08 16:00 +0100
    Re: [PATCH v2] xen/scsifront: don't request a slot on the ring until  request is ready Juergen Gross <jgross@suse.com> - 2016-12-09 11:20 +0100

csiph-web