]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: scsi_debug: Implement PRE-FETCH commands
authorDouglas Gilbert <dgilbert@interlog.com>
Tue, 21 Apr 2020 15:14:22 +0000 (11:14 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 May 2020 03:06:44 +0000 (23:06 -0400)
commit4a1e89ff9dfaadbd608fce6ea29fdc3d4af2e760
treeed67a2b1e180891fc82c2ee6ab35636ec985ec38
parentc5e82541eef73da0c9b754dd87493d97a131ca4c
scsi: scsi_debug: Implement PRE-FETCH commands

Many disks implement the SCSI PRE-FETCH commands. One use case might be a
disk-to-disk compare, say between disks A and B. Then this sequence of
commands might be used: PRE-FETCH(from B, IMMED), READ(from A), VERIFY
(BYTCHK=1 on B with data returned from READ).  The PRE-FETCH (which returns
quickly due to the IMMED) fetches the data from the media into B's cache
which should speed the trailing VERIFY command. The next chunk of the
compare might be done in parallel, with A and B reversed.

The implementation tries to bring the specified range in main memory into
the cache(s) associated with this machine's CPU(s) using the
prefetch_range() function.

Link: https://lore.kernel.org/r/20200421151424.32668-7-dgilbert@interlog.com
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_debug.c