]> Gentwo Git Trees - linux/.git/commit
vhost-scsi: Allocate iov_iter used for unaligned copies when needed
authorMike Christie <michael.christie@oracle.com>
Tue, 3 Dec 2024 19:15:14 +0000 (13:15 -0600)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 24 Feb 2025 21:48:00 +0000 (16:48 -0500)
commit53d09d0c3c6db9229e349e68ea99a9f7c1e61d8f
treeebdaa531e50bbd712b560893113a4f01eb522cff
parentac69f195ab6e3905e48895f993a8e99918bb7762
vhost-scsi: Allocate iov_iter used for unaligned copies when needed

It's extremely rare that we get unaligned requests that need to drop
down to the data copy code path. However, the iov_iter is almost 5% of
the mem used for the vhost_scsi_cmd. This patch has us allocate the
iov_iter only when needed since it's not a perf path that uses the
struct. This along with the patches that removed the duplicated fields on
the vhost_scsd_cmd allow us to reduce mem use by 1 MB in mid size setups
where we have 16 virtqueues and are doing 1024 cmds per queue.

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