From: Douglas Gilbert <dgilbert@interlog.com>
To: linux-scsi@vger.kernel.org
Cc: martin.petersen@oracle.com, jejb@linux.vnet.ibm.com,
hare@suse.de, bvanassche@acm.org
Subject: [PATCH 0/5] scatterlist: add operations for scsi_debug
Date: Sun, 23 Oct 2022 21:02:39 -0400 [thread overview]
Message-ID: <20221024010244.9522-1-dgilbert@interlog.com> (raw)
The scsi_debug driver is essentially a ramdisk dressed up as a SCSI host
with one or more SCSI devices attached. Like all low level SCSI drivers,
the scsi_debug driver receives and provides data to the SCSI mid-level
(and the block layer) using scatterlists whose interface is found in
include/linux/scatterlist.h .
After trying kmalloc() then vmalloc() based storage for the scsi_debug
driver, it was found that certain SCSI commands can be optimized if
instead one or more scatterlists is used as its backing store. The
specific SCSI command that benefits is VERIFY(BYTCHK=1) and the
equivalent NVMe command is COMPARE. These commands have data-out
buffers provided by an application that are compared by the storage
device with the LBA and count (of block) given in the command. In this
case the sgl_equal_sgl() function can be used instead of setting up
a temporary buffer.
The implementation of the more common SCSI READ and WRITE commands are
simplified by using the sgl_copy_sgl() function.
The first patch in this series removes an undocumented 4 GB limit in
the existing sgl_alloc_order() function.
In the final patch of this series, the scsi_debug driver uses the
new facilities in scatterlist to replace its vmalloc() backing store.
Douglas Gilbert (5):
sgl_alloc_order: remove 4 GiB limit
scatterlist: add sgl_copy_sgl() function
scatterlist: add sgl_equal_sgl() function
scatterlist: add sgl_memset()
scsi_debug: change store from vmalloc to sgl
drivers/scsi/Kconfig | 3 +-
drivers/scsi/scsi_debug.c | 478 +++++++++++++++++++++++++-----------
include/linux/scatterlist.h | 33 ++-
lib/scatterlist.c | 253 ++++++++++++++++---
4 files changed, 596 insertions(+), 171 deletions(-)
--
2.37.3
next reply other threads:[~2022-10-24 1:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 1:02 Douglas Gilbert [this message]
2022-10-24 1:02 ` [PATCH 1/5] sgl_alloc_order: remove 4 GiB limit Douglas Gilbert
2022-10-24 12:21 ` Jason Gunthorpe
2022-10-24 14:32 ` Bodo Stroesser
2022-10-24 17:32 ` Jason Gunthorpe
2022-10-24 19:58 ` Douglas Gilbert
2022-10-25 12:19 ` Jason Gunthorpe
2022-10-25 10:46 ` Bodo Stroesser
2022-10-25 12:18 ` Jason Gunthorpe
2022-10-24 1:02 ` [PATCH 2/5] scatterlist: add sgl_copy_sgl() function Douglas Gilbert
2022-10-24 1:02 ` [PATCH 3/5] scatterlist: add sgl_equal_sgl() function Douglas Gilbert
2022-10-24 1:02 ` [PATCH 4/5] scatterlist: add sgl_memset() Douglas Gilbert
2022-10-24 1:02 ` [PATCH 5/5] scsi_debug: change store from vmalloc to sgl Douglas Gilbert
2022-10-24 15:08 ` Bodo Stroesser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221024010244.9522-1-dgilbert@interlog.com \
--to=dgilbert@interlog.com \
--cc=bvanassche@acm.org \
--cc=hare@suse.de \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox