mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: lambert.quentin@gmail.com, jejb@linux.vnet.ibm.com,
	xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com,
	dan.carpenter@oracle.com, martin.petersen@oracle.com,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [Xen-devel] [PATCH] xen/scsifront: don't advance ring request pointer in case of error
Date: Tue, 29 Nov 2016 13:33:02 +0100	[thread overview]
Message-ID: <495b2925-b280-8f23-3798-e0da16dbd884@suse.com> (raw)
In-Reply-To: <583D772D02000078001232DD@suse.com>

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

  parent reply	other threads:[~2016-11-29 12:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-19 18:22 [PATCH] xen-scsifront: Add a missing call to kfree Quentin Lambert
2016-11-21  6:01 ` Juergen Gross
2016-11-22  3:40   ` Martin K. Petersen
2016-11-22  5:19     ` Juergen Gross
2016-11-25 21:28   ` Dan Carpenter
2016-11-29 10:50     ` [PATCH] xen/scsifront: don't advance ring request pointer in case of error Juergen Gross
2016-11-29 11:14       ` [Xen-devel] " Jan Beulich
     [not found]       ` <583D712F0200007800123283@suse.com>
2016-11-29 11:19         ` Juergen Gross
2016-11-29 11:28           ` David Vrabel
2016-11-29 11:33             ` Juergen Gross
2016-11-29 11:40           ` Jan Beulich
     [not found]           ` <583D772D02000078001232DD@suse.com>
2016-11-29 12:33             ` Juergen Gross [this message]
2016-12-02  6:10     ` [PATCH v2] xen/scsifront: don't request a slot on the ring until request is ready Juergen Gross
2016-12-02  6:13     ` Juergen Gross
2016-12-02  6:15     ` Juergen Gross
2016-12-05 15:32       ` Boris Ostrovsky
2016-12-05 15:35         ` Juergen Gross
2016-12-08 14:56       ` Boris Ostrovsky
2016-12-09 10:13       ` Juergen Gross
2016-12-05 20:53   ` [PATCH] xen-scsifront: Add a missing call to kfree Dan Carpenter
2016-12-06  5:45     ` Juergen Gross
2016-12-06 10:22       ` Dan Carpenter
2016-11-24  8:24 ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=495b2925-b280-8f23-3798-e0da16dbd884@suse.com \
    --to=jgross@suse.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=dan.carpenter@oracle.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=lambert.quentin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome