All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xianting Tian <xianting.tian@linux.alibaba.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: mst@redhat.com, jasowang@redhat.com,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] virtio_ring: add unlikely annotation for free descs check
Date: Mon, 4 Apr 2022 23:11:16 +0800	[thread overview]
Message-ID: <073dc28b-1707-cd04-daba-13aa4fac5a85@linux.alibaba.com> (raw)
In-Reply-To: <20220329075024.eoajm5ufrcfytug4@sgarzare-redhat>

I can't find it in next branch, will you apply this patch?

在 2022/3/29 下午3:50, Stefano Garzarella 写道:
> On Mon, Mar 28, 2022 at 06:58:17PM +0800, Xianting Tian wrote:
>> The 'if (vq->vq.num_free < descs_used)' check will almost always be 
>> false.
>>
>> Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
>> ---
>> drivers/virtio/virtio_ring.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>
>>
>> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
>> index d597fc0874ec..ab6d5f0cb579 100644
>> --- a/drivers/virtio/virtio_ring.c
>> +++ b/drivers/virtio/virtio_ring.c
>> @@ -525,7 +525,7 @@ static inline int virtqueue_add_split(struct 
>> virtqueue *_vq,
>>         descs_used = total_sg;
>>     }
>>
>> -    if (vq->vq.num_free < descs_used) {
>> +    if (unlikely(vq->vq.num_free < descs_used)) {
>>         pr_debug("Can't add buf len %i - avail = %i\n",
>>              descs_used, vq->vq.num_free);
>>         /* FIXME: for historical reasons, we force a notify here if
>> -- 
>> 2.17.1
>>

  reply	other threads:[~2022-04-04 15:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 10:58 [PATCH 1/2] virtio_ring: remove unnecessary to_vvq call in vring hot path Xianting Tian
2022-03-28 10:58 ` [PATCH 2/2] virtio_ring: add unlikely annotation for free descs check Xianting Tian
2022-03-29  4:57   ` Jason Wang
2022-03-29  4:57     ` Jason Wang
2022-03-29  7:50   ` Stefano Garzarella
2022-03-29  7:50     ` Stefano Garzarella
2022-04-04 15:11     ` Xianting Tian [this message]
2022-04-04 16:27       ` Michael S. Tsirkin
2022-04-04 16:27         ` Michael S. Tsirkin
2022-03-29  4:56 ` [PATCH 1/2] virtio_ring: remove unnecessary to_vvq call in vring hot path Jason Wang
2022-03-29  4:56   ` Jason Wang
2022-03-29  7:49 ` Stefano Garzarella
2022-03-29  7:49   ` Stefano Garzarella

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=073dc28b-1707-cd04-daba-13aa4fac5a85@linux.alibaba.com \
    --to=xianting.tian@linux.alibaba.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.