]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: core: Remove an atomic instruction from the hot path
authorBart Van Assche <bvanassche@acm.org>
Wed, 16 Jan 2019 00:50:03 +0000 (16:50 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 23 Jan 2019 02:18:27 +0000 (21:18 -0500)
commitb127c45535d9c101a84596c0de41fb08792e7edc
treeb4e0e9b9287603e730727eb9cfd2aa941c19f778
parent566c9769f4ef8ae49e49bed338a8c97a1d2d298c
scsi: core: Remove an atomic instruction from the hot path

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.

See also commit d1ed485087aa ("scsi: Do not rely on blk-mq for double
completions").

Cc: Keith Busch <keith.busch@intel.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c