Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2101375rwd; Fri, 9 Jun 2023 06:45:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ69Gz5TDZuQzj8QUjk5q1XhHa3GtuUpFXEH52sboa9FF122lZhgbMJq8NdJA4p+fZElch5f X-Received: by 2002:a05:6a00:1d06:b0:63d:2d6a:47be with SMTP id a6-20020a056a001d0600b0063d2d6a47bemr1430519pfx.2.1686318338898; Fri, 09 Jun 2023 06:45:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686318338; cv=none; d=google.com; s=arc-20160816; b=I0NH8p94ONJ1QayG5NB9sW+HMTr3OthTuvhWItsXs05RfHhsbdNgsiXzQbq7/qyHjK BMlxZHq3dAJw5IwyF4kZWbHq5OUXTkzjUK9jLfX0v1iISYXIkH3so3qeSCG6V4cQa3Oj 544l2sHHPP/uVrzLEibOl9CC1GwZsnA1NYAFuppviwB4HQSQuRcEdwBQoYc9+CkOS3SO RGngQQ+VkczV5QK3m/77MEVvLfhu/TsJHMM3gjxAzxpICtbrhgaNIkTA1cl99k1Ax5/U +n9M8Ou5i4nq2Yqs0t/dlPrBWLiL72TWK89AsgZJiFOkT5tqHHasfv0lphVuJWCLhQk0 jWjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vGg+rpYyecGmJ7XeyixeGaMFx1xKeTnsnNtuOdm7UUQ=; b=sll54by8xDSJQiteW+SnE18EdeaQAh+nXoR/h8rSVVbA2WFECc8unhNySFO+OiOyok Q4tNRm12XgcNouOe64l2Rvm5tqZn0dcwMMCys1VJcmYfMLvdvU+JM06a88KQkBWXpAFA uesoBVMYbriDjLP3q22zkep7YHicJ4eW5eAAiLihF3QMxbYdYt8j7G45hZTT9UV9L0CW tEBJWlwXR/wamja3OopohxnGEBDz+rsRK5mp+xjc0VlneJuxXKdpOgTHXvvqCqUIGlDr mAU2OliyCOXqBmBDkHzM5ACxSFBCj+RBF0oGFwvrJFx31XnTPD9gFsEFP5tduz7USTKd wcEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Q491ic/R"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g17-20020aa79f11000000b0063b88f52220si2519950pfr.144.2023.06.09.06.45.21; Fri, 09 Jun 2023 06:45:38 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Q491ic/R"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239375AbjFINj3 (ORCPT + 99 others); Fri, 9 Jun 2023 09:39:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238922AbjFINj3 (ORCPT ); Fri, 9 Jun 2023 09:39:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F1E530F1; Fri, 9 Jun 2023 06:39:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E527A60A09; Fri, 9 Jun 2023 13:39:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C55D1C433EF; Fri, 9 Jun 2023 13:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686317967; bh=ysACDiqv15WSMXirEWH3zL+zB9JT9lU1CCHgbJhy5TE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q491ic/RaHa+u/BYxn7wQszigsvRP+P1XgWnsp1LVSiiDa4mvI4Xji+qtIq8FstIU MEewjMnx+h3oKO3CAt3N47Aq/KcAy8AQpwf27CUDtfHPHOEY9Nh1mhgAWek+ZhyXZl Jin0GrVesqAewd3dZuIllGKzlIguXJQeyiIn8ZJ4= Date: Fri, 9 Jun 2023 15:39:24 +0200 From: Greg KH To: Xianting Tian Cc: 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, marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com, linux-bluetooth@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Xianting Tian Subject: Re: [PATCH 1/3] virtio-crypto: fixup potential cpu stall when free unused bufs Message-ID: <2023060924-skinning-reset-e256@gregkh> References: <20230609131817.712867-1-xianting.tian@linux.alibaba.com> <20230609131817.712867-2-xianting.tian@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230609131817.712867-2-xianting.tian@linux.alibaba.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Fri, Jun 09, 2023 at 09:18:15PM +0800, Xianting Tian wrote: > From: Xianting Tian > > 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/crypto/virtio/virtio_crypto_core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/crypto/virtio/virtio_crypto_core.c b/drivers/crypto/virtio/virtio_crypto_core.c > index 1198bd306365..94849fa3bd74 100644 > --- a/drivers/crypto/virtio/virtio_crypto_core.c > +++ b/drivers/crypto/virtio/virtio_crypto_core.c > @@ -480,6 +480,7 @@ static void virtcrypto_free_unused_reqs(struct virtio_crypto *vcrypto) > kfree(vc_req->req_data); > kfree(vc_req->sgs); > } > + cond_resched(); that's not "fixing a stall", it is "call the scheduler because we are taking too long". The CPU isn't stalled at all, just busy. Are you sure this isn't just a bug in the code? Why is this code taking so long that you have to force the scheduler to run? This is almost always a sign that something else needs to be fixed instead. thanks, greg k-h