Re: [PATCH v2 7/7] Remove an atomic instruction from the hot path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 15, 2019 at 04:50:03PM -0800, Bart Van Assche wrote:
> From scsi_init_command(), a function called by scsi_mq_prep_fn():
> 
> 	/* 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);
> 
> In other words, scsi_mq_prep_fn() clears scsi_cmnd.flags. Hence move
> the clear_bit() call into the else branch, the only branch in which
> this code is necessary.

Right, good call. You can even safely use "cmd->state = 0" in this
path instead of clear_bit(), but last time there were objections to
it looking inconsistent with the completion+timeout paths that use it
atomicly. Anyway,

Reviewed-by: Keith Busch <keith.busch@xxxxxxxxx>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux