Skip to content

scsi_debug: collection of additions

Douglas Gilbert linux-scsi 2 versions – Applied

Status from this message: Applied to 5.18/scsi-queue, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 2 repliesApplied
  2. v19 patches 3 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/9scsi_debug: address races following module loaddrivers/scsi/scsi_debug.c+146 -510 replies
2/9scsi_debug: strengthen defer_t accessesdrivers/scsi/scsi_debug.c+11 -110 replies
3/9scsi_debug: use task set full moredrivers/scsi/scsi_debug.c+6 -130 replies
4/9scsi_debug: refine sdebug_blk_mq_polldrivers/scsi/scsi_debug.c+16 -50 replies
5/9scsi_debug: divide power on reset unit attentiondrivers/scsi/scsi_debug.c+19 -110 replies
6/9scsi_debug: add no_rwlock parameterdrivers/scsi/scsi_debug.c+102 -500 replies
7/9scsi_debug: add sdeb_sgl_copy_sgl and friendsdrivers/scsi/scsi_debug.c+127 -00 replies
8/9scsi_debug: change store from vmalloc to sgldrivers/scsi/Kconfig drivers/scsi/scsi_debug.c+371 -1510 replies
9/9scsi_debug: add environmental reporting log subpagedrivers/scsi/scsi_debug.c+33 -00 replies

Reviews trailers per patch

1 of 9 patches has a Reviewed-by or Acked-by.

PatchBodo StroesserShin'ichiro Kawasaki
1/9
2/9
3/9
4/9
5/9
6/9
7/9R-b
8/9T-b
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/9] scsi_debug: collection of additions

The first patch is to address possible modprobe rmmod races.

The second patch adds READ_ONCE and WRITE_ONCE on several high frequency variables.

See the headers of patches 3 and 4.

In patch 5 use different asc/ascq codes to distiguish between a newly added LU and a reset of an existing LU.

In patch 6 add a no_rwlock module option to bypass the read-write locks around user data reads and writes.

Patch 7 adds sdeb_sgl_copy_sgl, sdeb_sgl_compare_sgl_idx, sdeb_sgl_compare_sgl and sdeb_sgl_memset functions for performing sgl to sgl copy and compare operations currently unsupported by scatterlist.h . This patch was originally put forward as an enhancement of scatterlist.h but failed to gain traction. So that patch is redirected to this driver with the "sdeb_" prefix on each function. Compiling the driver after this patch will result in warnings that those newly introduced static functions are not used. Since LLDs receive and send data "up" the stack via sgl_s, using sgl_s as the storage medium for this driver bypasses one level of conversions (i.e. bypasses using a 'flat' array).

Patch 8 uses the new functions introduced in patch 7 to change the internal store(s) used by this driver from big vmalloc() allocations to sgl_s. The biggest improvement is with the VERIFY(BYTCHK=1) performance that went from about 20% slower than a copy operation to 50% faster (up to a compare rate of 15 GB/s on my equipment). Before this patch VERIFY(BYTCHK=1) needed a temporary, potentially large, buffer for the incoming data-out transfer. The COMPARE AND WRITE (CAW) command also benefits from stores made of sgl_s. In addition CAW needs to know the index of the first mismatched byte (if any).

Finally some issues have arisen in smartmontools with SCSI log subpages. To aid in fixing this, the last patch adds this driver's first log subpage (Environmental Reporting).

This patchset is based on lk 5.16.0-rc8 rather than MKP's repository (based on rc1). Fixes have been added to this driver between rc1 and rc8 that would break a patchset trying to target both. So the most recent rc was chosen.

Changes since v1 [sent to linux-scsi list on 20211230]
- in the first patch replace READ_ONCE() and WRITE_ONCE() with smp_load_acquire() and smp_store_release() as suggested by Bart
- add Tested-by: Shin'ichiro Kawasaki on patch 8
- rework prot_verify_read() to remove heap allocation; if it failed previously the code return '-1' which Dan Carpenter termed as "sloppy"
- rebase on rc8 (was rc7)

Douglas Gilbert (9):
scsi_debug: address races following module load
scsi_debug: strengthen defer_t accesses
scsi_debug: use task set full more
scsi_debug: refine sdebug_blk_mq_poll
scsi_debug: divide power on reset unit attention
scsi_debug: add no_rwlock parameter
scsi_debug: add sdeb_sgl_copy_sgl and friends
scsi_debug: change store from vmalloc to sgl
scsi_debug: add environmental reporting log subpage

 drivers/scsi/Kconfig      |    3 +-
 drivers/scsi/scsi_debug.c | 1104 +++++++++++++++++++++++++++----------
 2 files changed, 823 insertions(+), 284 deletions(-)
Signature · 1 line
2.25.1