]> Gentwo Git Trees - linux/.git/commit
vhost-scsi: Reduce mem use by moving upages to per queue
authorMike Christie <michael.christie@oracle.com>
Tue, 3 Dec 2024 19:15:08 +0000 (13:15 -0600)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 24 Feb 2025 21:47:59 +0000 (16:47 -0500)
commita75293c4979cd5ae00bf02fc2dc19b2d58dbb843
tree892639e7e63b47ac4946b6d96b19a5b33f51fac4
parent0c73c0cfb4bef3412e808d42bc763345833e9861
vhost-scsi: Reduce mem use by moving upages to per queue

Each worker thread can process 1 command at a time so there's no need to
allocate a upages array per cmd. This patch moves it to per queue. Even a
small device with 128 cmds and 1 queue this brings mem use for the array
from

2 MB = 8 bytes per page pointer * 2048 pointers * 128 cmds

to

16K = 8 bytes per pointer * 2048 * 1 queue

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Message-Id: <20241203191705.19431-2-michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
drivers/vhost/scsi.c