lkml.org 
[lkml]   [2022]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] virtio_ring: add unlikely annotation for free descs check
From
Date
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
>>

\
 
 \ /
  Last update: 2022-04-04 17:12    [W:0.103 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site