Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-13 15:57:09 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-13 15:57:17 +0200
commitbbb67e72aafdd11d5a53f9602f08b032b402e175 (patch)
tree93aeef46a6b374a0772269ab447c7ce46f21953a
parent87588e291e05e828085a53c1d33ac1c1ec9da5af (diff)
virtio-blk: limit number of hw queues by nr_cpu_ids
(bsc#1051510). suse-commit: e8aa97943b5bdb1d5f8646f8483320a84a1a3617
-rw-r--r--drivers/block/virtio_blk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 98d3e8f37cc0..a51044c8dfca 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -433,6 +433,8 @@ static int init_vq(struct virtio_blk *vblk)
if (err)
num_vqs = 1;
+ num_vqs = min_t(unsigned int, nr_cpu_ids, num_vqs);
+
vblk->vqs = kmalloc_array(num_vqs, sizeof(*vblk->vqs), GFP_KERNEL);
if (!vblk->vqs)
return -ENOMEM;