From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: Akinobu Mita <akinobu.mita@gmail.com>,
Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
"James E.J. Bottomley" <JBottomley@parallels.com>,
Douglas Gilbert <dgilbert@interlog.com>
Subject: [PATCH v2 6/6] scsi_debug: allow huge transfer length for read/write commands
Date: Mon, 2 Jun 2014 22:56:49 +0900 [thread overview]
Message-ID: <1401717409-5236-7-git-send-email-akinobu.mita@gmail.com> (raw)
In-Reply-To: <1401717409-5236-1-git-send-email-akinobu.mita@gmail.com>
This change enables to test read/write commands with huge transfer
length such as 1GB. For example:
# modprobe scsi_debug dev_size_mb=1024 clustering=1 opts=1
# cat /sys/block/$DEV/queue/max_hw_sectors_kb > \
/sys/block/$DEV/queue/max_sectors_kb
# fio --name=test --rw=write --bs=1g --size=1g --filename=/dev/$DEV \
--mem=mmaphuge --direct=1
The data type of max_sectors in scsi_host_template has been extended
to unsigned int by the previous change. So we can increase it from
0xffff to 0xffffffff to allow such huge transfer length.
Also, this increases sg_tablesize and max_segment_size, otherwise the
maximum transfer length is limited to 64MB.
(sg_tablesize * max_segment_size = 256 * 256KB)
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Cc: linux-scsi@vger.kernel.org
---
No change from previous version.
drivers/scsi/scsi_debug.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index f3e9cc0..35ce1fa 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -2483,7 +2483,7 @@ static int scsi_debug_slave_configure(struct scsi_device *sdp)
if (sdp->host->cmd_per_lun)
scsi_adjust_queue_depth(sdp, SDEBUG_TAGGED_QUEUING,
sdp->host->cmd_per_lun);
- blk_queue_max_segment_size(sdp->request_queue, 256 * 1024);
+ blk_queue_max_segment_size(sdp->request_queue, -1U);
if (scsi_debug_no_uld)
sdp->no_uld_attach = 1;
return 0;
@@ -3938,9 +3938,9 @@ static struct scsi_host_template sdebug_driver_template = {
.bios_param = scsi_debug_biosparam,
.can_queue = SCSI_DEBUG_CANQUEUE,
.this_id = 7,
- .sg_tablesize = 256,
+ .sg_tablesize = SCSI_MAX_SG_CHAIN_SEGMENTS,
.cmd_per_lun = 16,
- .max_sectors = 0xffff,
+ .max_sectors = -1U,
.use_clustering = DISABLE_CLUSTERING,
.module = THIS_MODULE,
};
--
1.9.1
next prev parent reply other threads:[~2014-06-02 13:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-02 13:56 [PATCH v2 0/6] scsi: increase upper limit for max_sectors Akinobu Mita
2014-06-02 13:56 ` [PATCH v2 1/6] block: fix BLKSECTGET ioctl when max_sectors is greater than USHRT_MAX Akinobu Mita
2014-06-02 17:09 ` Martin K. Petersen
2014-06-02 13:56 ` [PATCH v2 2/6] block: fix SG_[GS]ET_RESERVED_SIZE ioctl when max_sectors is huge Akinobu Mita
2014-06-02 13:56 ` [PATCH v2 3/6] sg: prevent integer overflow when converting from sectors to bytes Akinobu Mita
2014-06-02 17:05 ` Douglas Gilbert
2014-06-02 13:56 ` [PATCH v2 4/6] sd: use READ_16 or WRITE_16 when transfer length is greater than 0xffff Akinobu Mita
2014-06-02 17:00 ` Martin K. Petersen
2014-06-02 13:56 ` [PATCH v2 5/6] scsi: increase upper limit for max_sectors Akinobu Mita
2014-06-02 17:01 ` Martin K. Petersen
2014-06-02 13:56 ` Akinobu Mita [this message]
2014-06-02 17:06 ` [PATCH v2 6/6] scsi_debug: allow huge transfer length for read/write commands Douglas Gilbert
2014-06-02 17:08 ` Martin K. Petersen
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=1401717409-5236-7-git-send-email-akinobu.mita@gmail.com \
--to=akinobu.mita@gmail.com \
--cc=JBottomley@parallels.com \
--cc=axboe@kernel.dk \
--cc=dgilbert@interlog.com \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).