Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2080789rwd; Fri, 9 Jun 2023 06:29:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5s+g2K/67I3vwnnlRv1u1DzPc+NCkwNSeka12rjNrt/8Z84Fm+2MvU7jW5yA82KdRIYRjG X-Received: by 2002:a17:902:e744:b0:1af:b80a:b964 with SMTP id p4-20020a170902e74400b001afb80ab964mr1598851plf.5.1686317381145; Fri, 09 Jun 2023 06:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686317381; cv=none; d=google.com; s=arc-20160816; b=js50BPDpZrgrhnv8+3DdZI18LOBgpSinst8wP3mdvPNfKCHDYPW6F7E6les1vciVHt bq4unls8dKYfLKBJMHADWwpr1i3sLfuoRlbPK17hv7/4e+yvDT4wQ8ps+ZmfhYE+/IeJ WT3ABr8U83xjlmXkvHo530lPAl5p4PWqaHZ+kTbA5b5yKCmzYwnY2TUfqF3hnxJwfzXO osW8C9HW849BoiamZNLCWbUQh45qCtglk92xtm8aJtUzK3U8fDootQ6RK4ACIEpRup4B 7txDWaOTyRLfSoyC01kEpIzn6cu3hS5/ySUFPdblLHGm1QxcRE3vyl+uZ2E6CtSC2EZI FjyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=Hx3fv2rxQMHMn1T/BGxaFYtNe9R54LhHL7uvlHgwdFo=; b=IT/Am8W1UXsT5wNd0RAWXroNBGbDpZMW9NCBkgF+Yk7TFizcl1wVd6JeJaNHRsytdq D6RFtMooBF1ht2zDNAbrzCwMHPcXDFr725RnNyNKZKDxJXB7IIU3qz6zp5QObTD5orZA m/p/+ezxOWLkySomVAC//0zJyVR3Ch3SqNKqLks6L4q1NzO/knzUUgmxHadw8IdfJXBl gR0m574qC/EBqDn3Oqcj1WBxoJZ9dfGzpohB5dLngbqaUM9C0GenHaUcem6VhqLxxG7Z zwHhxMpgoyFiE0O2DHHHIyytduf+kiAjs3OJHB/L4PwfAtp8+zqvPBUBdgx/HzC7CW/2 nd0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 l13-20020a170903244d00b001b010445600si2697955pls.500.2023.06.09.06.29.28; Fri, 09 Jun 2023 06:29:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 S241383AbjFINSz (ORCPT + 99 others); Fri, 9 Jun 2023 09:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241082AbjFINSl (ORCPT ); Fri, 9 Jun 2023 09:18:41 -0400 Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD803136; Fri, 9 Jun 2023 06:18:35 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0VkiFABK_1686316710; Received: from localhost.localdomain(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0VkiFABK_1686316710) by smtp.aliyun-inc.com; Fri, 09 Jun 2023 21:18:30 +0800 From: Xianting Tian To: arei.gonglei@huawei.com, mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, herbert@gondor.apana.org.au, davem@davemloft.net, amit@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com Cc: linux-bluetooth@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Xianting Tian Subject: [PATCH 2/3] virtio_console: fixup potential cpu stall when free unused bufs Date: Fri, 9 Jun 2023 21:18:16 +0800 Message-Id: <20230609131817.712867-3-xianting.tian@linux.alibaba.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230609131817.712867-1-xianting.tian@linux.alibaba.com> References: <20230609131817.712867-1-xianting.tian@linux.alibaba.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,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-crypto@vger.kernel.org Cpu stall issue may happen if device is configured with multi queues and large queue depth, so fix it. Signed-off-by: Xianting Tian --- drivers/char/virtio_console.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index b65c809a4e97..5ec4cf4ea919 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1935,6 +1935,7 @@ static void remove_vqs(struct ports_device *portdev) flush_bufs(vq, true); while ((buf = virtqueue_detach_unused_buf(vq))) free_buf(buf, true); + cond_resched(); } portdev->vdev->config->del_vqs(portdev->vdev); kfree(portdev->in_vqs); -- 2.17.1