Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3473927pxb; Mon, 4 Apr 2022 18:06:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaUr4QjfMY6UMhT7k46sojJQ9Nl8/b/y+C2z7ZzqdnqZd+8KzFlSwVzD1kQ0rFufZkX+Ji X-Received: by 2002:a17:902:da83:b0:156:aa83:8409 with SMTP id j3-20020a170902da8300b00156aa838409mr876632plx.22.1649120797761; Mon, 04 Apr 2022 18:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649120797; cv=none; d=google.com; s=arc-20160816; b=oZ6exZHtZLwdlkgu53/EYTrCetE+z62gc2V8dz6MuTvcmRURTRoICdHYiDfebFTGuO FNz/mu/4HiH4Kt5D7/rZus5CISJetJC/FMJOTlUbB1roZ+21vyiNCpWHFwCUQM3bxcRi /1DgVSSyYVvDqUFwJnJ6d6rWy6Dj5huNxG/4Y4v4pzqFtTRgsnPhgg3zkv5WoL08yUTJ AvJsJ4MjiSnsP/BxoCD4lZTGzLv8n/UAtu8y4E97fISC3uwa0YFN8UtGQeej2R8i0gR1 xOC+0RPZYIzXCP27PZ1qL6cy8pjNSe96NBHeUuEEoWnk28rHQfnXjDDz0ZUkzcEepo0+ VtAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=YsYIhC652A9TtH3+mhgIz88fgLnf3wDA/KYRZgM937M=; b=pUQvwHfTr03+egN3FfcHTnEfWxoybLzID4c/sG6ULbKDLmuba/VrVtipA91gm71Ae5 EL/PlvUe+7NACVQBeTJEcSj0ljjzvIqCuJuTiytHzkbIYvNT1ONenSngaBeC54WdAJXt ypraLujzaObbyuOZE8SiLStYAonW7qvvcxQpJsGCZ//9V6+NjHxyc4Ldafgn6lxLIwmC 1exKXPZk9K74lDn9zbVLMWKDqqwioKONXGnkGwTxCTxJsnwLcWWXD+k+wyWHSUOSXOTU wHZRBCAhKoA0a3U+9+j+v9X2A0GbcjZkfgIRK5xkm9+W5va7HbKetzgbedhZ4eCUlojw LXjA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h128-20020a625386000000b004fa8a73c6ecsi10617839pfb.180.2022.04.04.18.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:06:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 51597141457; Mon, 4 Apr 2022 17:05:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378449AbiDDPNZ (ORCPT + 99 others); Mon, 4 Apr 2022 11:13:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378580AbiDDPNR (ORCPT ); Mon, 4 Apr 2022 11:13:17 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 294331263C for ; Mon, 4 Apr 2022 08:11:20 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0V9D7SET_1649085076; Received: from B-LB6YLVDL-0141.local(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0V9D7SET_1649085076) by smtp.aliyun-inc.com(127.0.0.1); Mon, 04 Apr 2022 23:11:18 +0800 Subject: Re: [PATCH 2/2] virtio_ring: add unlikely annotation for free descs check To: Stefano Garzarella Cc: mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20220328105817.1028065-1-xianting.tian@linux.alibaba.com> <20220328105817.1028065-2-xianting.tian@linux.alibaba.com> <20220329075024.eoajm5ufrcfytug4@sgarzare-redhat> From: Xianting Tian Message-ID: <073dc28b-1707-cd04-daba-13aa4fac5a85@linux.alibaba.com> Date: Mon, 4 Apr 2022 23:11:16 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20220329075024.eoajm5ufrcfytug4@sgarzare-redhat> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> --- >> drivers/virtio/virtio_ring.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > Reviewed-by: Stefano Garzarella > >> >> 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 >>