Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp239831rwr; Thu, 27 Apr 2023 00:08:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48vYSwM7FRscXAcLS/c03FX3CvieWkrdbN24GrrldN+SvwwrOiOAgCZDTKckq/8Cbdt+i6 X-Received: by 2002:a17:902:ce89:b0:1a4:f4e6:b68 with SMTP id f9-20020a170902ce8900b001a4f4e60b68mr699628plg.3.1682579283016; Thu, 27 Apr 2023 00:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682579282; cv=none; d=google.com; s=arc-20160816; b=zDy2vDg8rwuPb/R+5i16o2nZApcTCOPGjgJkYZ81EtWuCkedL+Z/+te2EG5UDphSuI 4eU12fpxOKG8tYrp2l07MxGtwnqpIWfVP6o8TRi8daTtDxFXwGZEMb+6PY3QLa11TmoL 3XT6QBpp4HV+Uge3W5zliUce9dJ7xkqDmJHpa4ID2XHs6fvsQHVzZCtgycRo8fR1Gyt2 DZgwja83S1EbIYZ2gSJRrd9PeVxfwg3mX1ZKpcFuoWvsFycOFhfg6P6NpiLkahPRnGSU 5H97Jt7hRluUQFq3QRPAhEZg9Xmrh9torCoL1mLW/KsGcVUD3xDUsek/Sjzeh9i7pWTI vFcA== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=AA9076PBQGQ1CvqVfefKSv2pXhUG01wTMuMnD2nJkG8=; b=VxzaZxnrYHZ/c9IWHbEjmB6+P4FAkfvz3qFQ1BoyFX2tzLtbdY7cjRjBvfPdytLUZ5 +HiQiuTuGot0OEX5NNXC7pVhLdKLy0V2hz4iIT8P5+zmEjY6GcUyFH7ObXAcOi9+hDMh ZeeqWD1dB7W90+gq3P2EgFJgUN1DNILhu2WKJmsgrWFuB8PGQSU+LcuV+5JBL+y8M+rz DSZYb5uHN7YQ03gFuun0P65PcR7Em1T1aH8O+9Pd0hCf5A1qAi0R5JSRqrJHC73KqAcd 65EIO1/eCfdpgoS1LFRYZyt7YKiO5XkJhYaFcfxXSeW+rOFygZK8qurW9extq9MXdEav T0Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b="jLGz1o/g"; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jb22-20020a170903259600b0019ec2a633f4si16944938plb.505.2023.04.27.00.07.49; Thu, 27 Apr 2023 00:08:02 -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; dkim=pass header.i=@bytedance.com header.s=google header.b="jLGz1o/g"; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243020AbjD0HDB (ORCPT + 99 others); Thu, 27 Apr 2023 03:03:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242974AbjD0HC5 (ORCPT ); Thu, 27 Apr 2023 03:02:57 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30FD3422B for ; Thu, 27 Apr 2023 00:02:32 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-64115e652eeso2799912b3a.0 for ; Thu, 27 Apr 2023 00:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1682578951; x=1685170951; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=AA9076PBQGQ1CvqVfefKSv2pXhUG01wTMuMnD2nJkG8=; b=jLGz1o/gOy7lZRmOeyA5yuMty1mAQ/iuWvCjMifOWvm0j4uLkXKiOgf9UM1A0iY5JH CwSyYAno6AlIplzeAwPsF10c4guM+QMfKhDDGeNLbz5axGI+qayc62rfYQLVXOkRS6vN HRaP5zRygf5AmKRpuXW3wF9qIEGE467ueDrsqFtcdGx0ucZ3hiZEtLGhV+JwGxEmmYMf ZIKCh7PIBKsUj37Sj9sgJd4gVxEP+II7OV/QbY19ys/2EgKPzMo4v8hQxdEkzENsEBOo duNOArJk+4/NimQH712r1Q3q6ldJcpe5y0uOnWQ1EIzf3i0jywK2ozryHq8GVamcGd1+ tArQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682578951; x=1685170951; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AA9076PBQGQ1CvqVfefKSv2pXhUG01wTMuMnD2nJkG8=; b=GYR1RGmdJQWmo16ga1LROjHExleA2vOLC7OzfoAUynDb+7F0nm9YNiLT3+il+ffT1g qN2BK8v2Y0QYtjS+yy1v24kx5HLbafUqMjukIlk1AKU0Hh1uPQVmVywCpcz4laCMQuI5 R1gSWXSAqGYKxxq4Qj1fyCIkpg2/aOpNO5Pk9nrpbRrPoqg/bdttAtl9wrHoGz3/+Ti/ 91IgMAEHhnNa3lLO9MbvxWf1YV779zZwNgRut8QbXmtCe926k02vtneb1EtjfuHyTStY SKxVSwAPaYJ0WOVTOCJU3lsNLqGPZJDrqqxtp7oH9kr2+aq7XpKEFjYvCjpBF4x4+67d 46mQ== X-Gm-Message-State: AC+VfDx83zPGWIlkTLELRPlI5PjYTReu9Jzbv5eWDu9lrWSdMjQIp9LD 7cJI4scUfnpdN0ReamuA9XAtQ49RIo+bfFJdfjOZEQT+tY8= X-Received: by 2002:a17:902:d484:b0:1a9:68d2:e4ae with SMTP id c4-20020a170902d48400b001a968d2e4aemr6110340plg.2.1682578951633; Thu, 27 Apr 2023 00:02:31 -0700 (PDT) Received: from [10.2.195.40] ([61.213.176.13]) by smtp.gmail.com with ESMTPSA id i13-20020a170902eb4d00b001a5023e7395sm10942150pli.135.2023.04.27.00.02.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Apr 2023 00:02:31 -0700 (PDT) Message-ID: <252ee222-f918-426e-68ef-b3710a60662e@bytedance.com> Date: Thu, 27 Apr 2023 15:02:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] virtio_net: suppress cpu stall when free_unused_bufs Content-Language: en-US To: Xuan Zhuo Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 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> <1682576442.2203932-1-xuanzhuo@linux.alibaba.com> From: Wenliang Wang In-Reply-To: <1682576442.2203932-1-xuanzhuo@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 4/27/23 2:20 PM, Xuan Zhuo wrote: > 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? 128 queues and 16K queue_size is typical. > >> 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? Rq buffers are pre-allocated, take seconds to free rq unused buffers. Sq unused buffers are much less, so do the same for sq is optional. > > Thanks. > > >> } >> } >> >> -- >> 2.20.1 >>