virtio-crypto: call scheduler when we free unused buffs
authorXianting Tian <tianxianting.txt@alibaba-inc.com>
Fri, 9 Jun 2023 13:18:15 +0000 (21:18 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 3 Jul 2023 16:15:12 +0000 (12:15 -0400)
For virtio-net we were getting CPU stall warnings, and fixed it by
calling the scheduler: see f8bb51043945 ("virtio_net: suppress cpu stall
when free_unused_bufs").

This driver is similar so theoretically the same logic applies.

Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
Message-Id: <20230609131817.712867-2-xianting.tian@linux.alibaba.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/crypto/virtio/virtio_crypto_core.c

index 1198bd3063655a87d7de886c7e9eecbd008d55ab..94849fa3bd74aaa85e7467a571b778e8e373417f 100644 (file)
@@ -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();
        }
 }