virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Xianting Tian <xianting.tian@linux.alibaba.com>
Cc: xuanzhuo@linux.alibaba.com, herbert@gondor.apana.org.au,
	arnd@arndb.de, mst@redhat.com, amit@kernel.org,
	marcel@holtmann.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-bluetooth@vger.kernel.org,
	Xianting Tian <tianxianting.txt@alibaba-inc.com>,
	linux-crypto@vger.kernel.org, luiz.dentz@gmail.com,
	davem@davemloft.net, johan.hedberg@gmail.com
Subject: Re: [PATCH 1/3] virtio-crypto: fixup potential cpu stall when free unused bufs
Date: Fri, 9 Jun 2023 15:39:24 +0200	[thread overview]
Message-ID: <2023060924-skinning-reset-e256@gregkh> (raw)
In-Reply-To: <20230609131817.712867-2-xianting.tian@linux.alibaba.com>

On Fri, Jun 09, 2023 at 09:18:15PM +0800, Xianting Tian wrote:
> From: Xianting Tian <tianxianting.txt@alibaba-inc.com>
> 
> Cpu stall issue may happen if device is configured with multi queues
> and large queue depth, so fix it.
> 
> Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
> ---
>  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
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

       reply	other threads:[~2023-06-09 13:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230609131817.712867-1-xianting.tian@linux.alibaba.com>
     [not found] ` <20230609131817.712867-2-xianting.tian@linux.alibaba.com>
2023-06-09 13:39   ` Greg KH [this message]
2023-06-09 13:41     ` [PATCH 1/3] virtio-crypto: fixup potential cpu stall when free unused bufs Greg KH
     [not found]       ` <91aa6ce0-e8a3-21ac-d29e-b2a47f6386d1@linux.alibaba.com>
2023-06-09 14:05         ` Greg KH
2023-06-09 16:02           ` Michael S. Tsirkin
2023-06-09 15:57   ` Michael S. Tsirkin
     [not found]     ` <a0a07bfd-6e44-5478-395d-be6c1f3bd92a@linux.alibaba.com>
2023-06-10  6:51       ` Greg KH
2023-06-09 15:58   ` Michael S. Tsirkin
     [not found] ` <20230609131817.712867-3-xianting.tian@linux.alibaba.com>
2023-06-09 16:05   ` [PATCH 2/3] virtio_console: " Michael S. Tsirkin
2023-06-22 11:59 ` [PATCH 0/3] fixup potential cpu stall Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2023060924-skinning-reset-e256@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=amit@kernel.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=mst@redhat.com \
    --cc=tianxianting.txt@alibaba-inc.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xianting.tian@linux.alibaba.com \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).