On 2020-02-28 01:33, Ming Lei wrote: > scsi host template struct is quite big, and the following three > fields are needed in SCSI IO path: > > - queuecommand > - commit_rqs > - cmd_size > > Cache them into scsi host intance, so that we can avoid to fetch > big scsi host template instance in IO path. > > 40% IOPS boost can be observed in my scsi_debug performance test after > applying this change. > > Cc: Sumanesh Samanta <sumanesh.samanta@xxxxxxxxxxxx> > Cc: Ewan D . Milne <emilne@xxxxxxxxxx> > Cc: Hannes Reinecke <hare@xxxxxxx> > Cc: Bart Van Assche <bart.vanassche@xxxxxxx> > Cc: Christoph Hellwig <hch@xxxxxx> Please use my current email address instead of the above old and no longer valid email address. See also the .mailmap file. I think I have asked this before. > @@ -1148,7 +1148,7 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) > in_flight = test_bit(SCMD_STATE_INFLIGHT, &cmd->state); > /* zero out the cmd, except for the embedded scsi_request */ > memset((char *)cmd + sizeof(cmd->req), 0, > - sizeof(*cmd) - sizeof(cmd->req) + dev->host->hostt->cmd_size); > + sizeof(*cmd) - sizeof(cmd->req) + dev->host->cmd_size); > > cmd->device = dev; > cmd->sense_buffer = buf; This patch does not apply on Martin's 5.7/scsi-queue branch. Please rebase. Thanks, Bart.