Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp204952rwr; Wed, 26 Apr 2023 23:28:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4h3mZMumoPezyAuGYSWW/ez8gL02KC5q9r2s8f6u4Ir9t4FUCDHjUvDTafOC3oOhDbY59u X-Received: by 2002:a05:6a00:414d:b0:5e4:f141:568b with SMTP id bv13-20020a056a00414d00b005e4f141568bmr796002pfb.3.1682576916195; Wed, 26 Apr 2023 23:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682576916; cv=none; d=google.com; s=arc-20160816; b=c3ADOoNE6nv5ta+siwAku45Xs/OjcgBvOA7toMOAEUJPzAmMlHi3HR393pM/omcWPE 4gcy4DB1RM8kV624LMgK1MvpkfSbtrIqMyXWJsMoQp70UkGoFE1CxaO+t3YhbB/beOIa Hygra4dYof3crsPvpI3yI9yiOZT2EfI9ScHKKHowD9mNC0ch0f9a34Rxln/q2+6UrwcB BLbTdzCBvSfhfzxqeY6mT3SITBa3zyFDaDqfzrib/PPWWQqftwUN8PAW0pqBtubz7S4R DELRSvsqNGupJkSP20mtWGr4I1lnVdXilIQHLyIASFvKB319AREAcVquPGWAU3WcrOFL iixQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:cc:to:from:date:subject :message-id; bh=q/NbfG8uyg0w/v+NGHCyMl0iZQdljpNoTF8iA5hFP2M=; b=P+CZ3tiPPANLFvWxBRaoEk6B/9+LJVqSBsij+lqMERmyTsBDWLvydsSdqXM31QQnvp irl6xdKs9H+ouQ1lLAUDETxOR7m5jbrbKiRZo1t1xrE79wlPCnqxs7bkFTD5C8Vx1VTP kLuIkWMUbQeRBlAuEedgaspNbMikssULIN1ev/YcVKTQOmVRX1/YzCTVPZMkHTbS3c9J i3YCx4xTzPI4tp6TnMdc6VnX+cTYu9putoDprCY1xqlkGpRbVEMS2gjFhCjRbGY8a7Dw 1rrgyvpQOfWfPhu/XWIYOSWS3vzdL5gpDaL1BKM+CxAWKzja+T1h9oqS74Rwl1ReFii1 nGtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 194-20020a6218cb000000b0063b64146c13si18379463pfy.254.2023.04.26.23.28.22; Wed, 26 Apr 2023 23:28:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243000AbjD0GXy (ORCPT + 99 others); Thu, 27 Apr 2023 02:23:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232898AbjD0GXw (ORCPT ); Thu, 27 Apr 2023 02:23:52 -0400 Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33B0A3C28; Wed, 26 Apr 2023 23:23:51 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=xuanzhuo@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0Vh6EyIG_1682576626; Received: from localhost(mailfrom:xuanzhuo@linux.alibaba.com fp:SMTPD_---0Vh6EyIG_1682576626) by smtp.aliyun-inc.com; Thu, 27 Apr 2023 14:23:47 +0800 Message-ID: <1682576442.2203932-1-xuanzhuo@linux.alibaba.com> Subject: Re: [PATCH] virtio_net: suppress cpu stall when free_unused_bufs Date: Thu, 27 Apr 2023 14:20:42 +0800 From: Xuan Zhuo To: Wenliang Wang Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Wenliang Wang , mst@redhat.com, jasowang@redhat.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com References: <20230427043433.2594960-1-wangwenliang.1995@bytedance.com> In-Reply-To: <20230427043433.2594960-1-wangwenliang.1995@bytedance.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham 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 On Thu, 27 Apr 2023 12:34:33 +0800, Wenliang Wang wrote: > For multi-queue and large rx-ring-size use case, the following error Cound you give we one number for example? > occurred when free_unused_bufs: > rcu: INFO: rcu_sched self-detected stall on CPU. > > Signed-off-by: Wenliang Wang > --- > drivers/net/virtio_net.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index ea1bd4bb326d..21d8382fd2c7 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -3565,6 +3565,7 @@ static void free_unused_bufs(struct virtnet_info *vi) > struct virtqueue *vq = vi->rq[i].vq; > while ((buf = virtqueue_detach_unused_buf(vq)) != NULL) > virtnet_rq_free_unused_buf(vq, buf); > + schedule(); Just for rq? Do we need to do the same thing for sq? Thanks. > } > } > > -- > 2.20.1 >