Commit fd47976
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>1 parent ddc5b5f commit fd47976
1 file changed
+17
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | | - | |
| 381 | + | |
| 382 | + | |
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
| |||
576 | 577 | | |
577 | 578 | | |
578 | 579 | | |
579 | | - | |
| 580 | + | |
580 | 581 | | |
581 | 582 | | |
582 | 583 | | |
| |||
624 | 625 | | |
625 | 626 | | |
626 | 627 | | |
627 | | - | |
| 628 | + | |
628 | 629 | | |
629 | 630 | | |
630 | 631 | | |
| |||
808 | 809 | | |
809 | 810 | | |
810 | 811 | | |
811 | | - | |
812 | | - | |
813 | | - | |
| 812 | + | |
| 813 | + | |
814 | 814 | | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
815 | 821 | | |
816 | 822 | | |
817 | 823 | | |
| |||
845 | 851 | | |
846 | 852 | | |
847 | 853 | | |
848 | | - | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
849 | 857 | | |
850 | 858 | | |
851 | 859 | | |
| |||
0 commit comments