From: Laurence Oberman <loberman@redhat.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>, linux-rdma@vger.kernel.org
Subject: Re: Cant write to max_sectors_kb on 4.5.0 SRP target
Date: Fri, 8 Apr 2016 04:31:29 -0400 (EDT) [thread overview]
Message-ID: <888890380.28014192.1460104289837.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <yq137qw6bzz.fsf@sermon.lab.mkp.net>
Hello Martin
Yes, Ewan also noticed that.
This started out as me testing the SRP stack on RHEL 7.2 and baselining against upstream.
We have a customer that requires 4MB I/O.
I bumped into a number of SRP issues including sg_map failures so started reviewing upstream changes to the SRP code and patches.
The RHEL kernel is ignoring this so perhaps we have an issue on our side (RHEL kernel) and upstream is behaving as it should.
What is intersting is that I cannot change the max_sectors_kb at all on the upstream for the SRP LUNS.
Here is an HP SmartArray LUN
[root@srptest ~]# sg_inq --p 0xb0 /dev/sda
VPD INQUIRY: page=0xb0
inquiry: field in cdb illegal (page not supported) **** Known that its not supported
However
/sys/block/sda/queue
[root@srptest queue]# cat max_hw_sectors_kb max_sectors_kb
4096
1280
[root@srptest queue]# echo 4096 > max_sectors_kb
[root@srptest queue]# cat max_hw_sectors_kb max_sectors_kb
4096
4096
On the SRP LUNS I am unable to change to a lower value than max_sectors_kb unless I change it to 128
So perhaps the size on the array is the issue here as Nicholas said and the RHEL kernel has a bug and ignores it.
/sys/block/sdc/queue
[root@srptest queue]# cat max_hw_sectors_kb max_sectors_kb
4096
1280
[root@srptest queue]# echo 512 > max_sectors_kb
-bash: echo: write error: Invalid argument
[root@srptest queue]# echo 256 > max_sectors_kb
-bash: echo: write error: Invalid argument
128 works
[root@srptest queue]# echo 128 > max_sectors_kb
Laurence Oberman
Principal Software Maintenance Engineer
Red Hat Global Support Services
----- Original Message -----
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: "Laurence Oberman" <loberman@redhat.com>
Cc: "linux-scsi" <linux-scsi@vger.kernel.org>, linux-rdma@vger.kernel.org
Sent: Thursday, April 7, 2016 11:00:16 PM
Subject: Re: Cant write to max_sectors_kb on 4.5.0 SRP target
>>>>> "Laurence" == Laurence Oberman <loberman@redhat.com> writes:
Laurence,
The target is reporting inconsistent values here:
> [root@srptest queue]# sg_inq --p 0xb0 /dev/sdb
> VPD INQUIRY: Block limits page (SBC)
> Maximum compare and write length: 1 blocks
> Optimal transfer length granularity: 256 blocks
> Maximum transfer length: 256 blocks
> Optimal transfer length: 768 blocks
OPTIMAL TRANSFER LENGTH GRANULARITY roughly translates to physical block
size or RAID chunk size. It's the smallest I/O unit that does not
require read-modify-write. It would typically be either 1 or 8 blocks
for a drive and maybe 64, 128 or 256 for a RAID5 array. io_min in
queue_limits.
OPTIMAL TRANSFER LENGTH indicates the stripe width and is a multiple of
OPTIMAL TRANSFER LENGTH GRANULARITY. io_opt in queue_limits.
MAXIMUM TRANSFER LENGTH indicates the biggest READ/WRITE command the
device can handle in a single command. In this case 256 blocks so that's
128K. max_dev_sectors in queue_limits.
>From SBC:
"A MAXIMUM TRANSFER LENGTH field set to a non-zero value indicates the
maximum transfer length in logical blocks that the device server accepts
for a single command shown in table 250. If a device server receives one
of these commands with a transfer size greater than this value, then the
device server shall terminate the command with CHECK CONDITION status
[...]"
So those reported values are off.
logical block size <= physical block size <= OTLG <= OTL <= MTL
Or in terms of queue_limits:
lbs <= pbs <= io_min <= io_opt <=
min_not_zero(max_dev_sectors, max_hw_sectors, max_sectors)
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2016-04-08 8:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <480311118.27942868.1460063633409.JavaMail.zimbra@redhat.com>
[not found] ` <480311118.27942868.1460063633409.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-04-07 21:15 ` Cant write to max_sectors_kb on 4.5.0 SRP target Laurence Oberman
[not found] ` <302427900.27942894.1460063713447.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-04-08 2:49 ` Bart Van Assche
2016-04-08 7:58 ` Laurence Oberman
2016-04-08 3:00 ` Martin K. Petersen
2016-04-08 8:31 ` Laurence Oberman [this message]
2016-04-08 12:39 ` Ewan D. Milne
[not found] ` <1460119192.25335.40.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2016-04-08 13:11 ` Laurence Oberman
[not found] ` <1975890115.28041373.1460121079252.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-04-11 14:57 ` Laurence Oberman
2016-04-11 21:29 ` Martin K. Petersen
2016-04-08 5:30 ` Nicholas A. Bellinger
2016-04-08 8:15 ` Laurence Oberman
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=888890380.28014192.1460104289837.JavaMail.zimbra@redhat.com \
--to=loberman@redhat.com \
--cc=linux-rdma@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).