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)
commited9f3e2513f91553cc7197e8739a38a9bdea5303
treeed67a2b1e180891fc82c2ee6ab35636ec985ec38
parenta2aede970a8e12cadb8be779066cd64e6dd37e82
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