[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b7fb2187-1475-4e39-927e-8b8990d4fbdd@oracle.com>
Date: Thu, 27 Mar 2025 13:27:36 -0700
From: Dongli Zhang <dongli.zhang@...cle.com>
To: Mike Christie <michael.christie@...cle.com>,
virtualization@...ts.linux.dev, kvm@...r.kernel.org,
netdev@...r.kernel.org
Cc: mst@...hat.com, jasowang@...hat.com, pbonzini@...hat.com,
stefanha@...hat.com, eperezma@...hat.com, joao.m.martins@...cle.com,
joe.jin@...cle.com, si-wei.liu@...cle.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 06/10] vhost-scsi: cache log buffer in I/O queue
vhost_scsi_cmd
Hi Mike,
On 3/26/25 4:37 PM, Mike Christie wrote:
> On 3/17/25 7:04 PM, Dongli Zhang wrote:
>> @@ -1390,6 +1424,24 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
>> goto err;
>> }
>>
>> + if (unlikely(vq_log && log_num)) {
>> + if (!cmd->tvc_log)
>> + cmd->tvc_log = kmalloc_array(vq->dev->iov_limit,
>> + sizeof(*cmd->tvc_log),
>> + GFP_KERNEL);
>> +
>> + if (likely(cmd->tvc_log)) {
>> + memcpy(cmd->tvc_log, vq->log,> + sizeof(*cmd->tvc_log) * log_num);
>> + cmd->tvc_log_num = log_num;
>
>
> Hey Dongli, this approach seems ok.
>
> Could you just move this to a function?
Sure. I may re-send v3 following this approach (allocate on-demand in runtime),
and encapsulate above code into a function.
Thank you very much!
Dongli Zhang
Powered by blists - more mailing lists