Skip to contentSkip to conversation

test sfdisk, optimal_iosize

PATCH Ruediger Meier 5 participants 9 messages Jan 29, 2016 – Feb 4, 2016 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I've got some test failures like

home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/output/sfdisk/dos-activate renamed from home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/expected/sfdisk/dos-activate +1 -1
@@ -6,7 +6,7 @@
 Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 4096 bytes
-I/O size (minimum/optimal): 4096 bytes / 32768 bytes
+I/O size (minimum/optimal): 4096 bytes / 64 bytes
 Disklabel type: dos
 Disk identifier: <removed>
 

optimal < minimum ... is this a bug?

Where does this optimal iosize come from, scsi_debug module? Is there a commandline tool to get this iosize, maybe blkid?

cu,
Rudi

maintainer
#1 lore raw

home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/output/sfdisk/dos-activate line 9

Quoted 12 lines · Ruediger Meier

Hi,

I've got some test failures like

home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/output/sfdisk/dos-activate renamed from home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/expected/sfdisk/dos-activate +1 -1
@@ -6,7 +6,7 @@
 Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 4096 bytes
-I/O size (minimum/optimal): 4096 bytes / 32768 bytes
+I/O size (minimum/optimal): 4096 bytes / 64 bytes

Very very strange. It seems like the number is in sectors (64 * 512 = 32768) rather than in bytes.

Quoted 8 lines
home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/output/sfdisk/dos-activate renamed from home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/expected/sfdisk/dos-activate +0 -0
 Disklabel type: dos
 Disk identifier: <removed>
 

optimal < minimum ... is this a bug?

Where does this optimal iosize come from, scsi_debug module? Is there a commandline tool to get this iosize, maybe blkid?

cat /sys/block/sda/queue/{optimal,minimum}_io_size cat /sys/block/sda/queue/{physical,logical}_block_size

The optimal IO size is often 0 (in /sys) in this case libfdisk fallback to minimal IO size.

Try
LIBFDISK_DEBUG=all fdisk -l /dev/sda

you will see something like:

8694: libfdisk:      CXT: [0x560e0bba9050]: /dev/sda: discovering topology...
8694: libfdisk:      CXT: [0x560e0bba9050]: initialize libblkid prober
8694: libfdisk:      CXT: [0x560e0bba9050]: result: log/phy sector size: 512/512
8694: libfdisk:      CXT: [0x560e0bba9050]: result: fdisk/optimal/minimal io: 512/0/512
8694: libfdisk:      CXT: [0x560e0bba9050]: /dev/sda: discovering geometry...
8694: libfdisk:      CXT: [0x560e0bba9050]: total sectors: 468862128 (ioctl=468862128)
8694: libfdisk:      CXT: [0x560e0bba9050]: result: C/H/S: 29185/255/63

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
maintainer
#2 lore raw
Quoted 5 lines · Karel Zak
Quoted 2 lines

Where does this optimal iosize come from, scsi_debug module? Is there a commandline tool to get this iosize, maybe blkid?

cat /sys/block/sda/queue/{optimal,minimum}_io_size cat /sys/block/sda/queue/{physical,logical}_block_size

And also by ioctl:

   blockdev --getiomin --getioopt /dev/sdc
Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#3 lore raw
In reply to Karel Zak
Quoted 28 lines · Karel Zak
Quoted 12 lines · Ruediger Meier

Hi,

I've got some test failures like

---
/home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/expe cted/sfdisk/dos-activate +++ /home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/outp ut/sfdisk/dos-activate @@ -6,7 +6,7 @@
Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes

home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/output/sfdisk/dos-activate line 9

Quoted 2 lines
home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/output/sfdisk/dos-activate renamed from home/abuild/rpmbuild/BUILD/util-linux-2.27.git247.4c01c/tests/expected/sfdisk/dos-activate +1 -1
-I/O size (minimum/optimal): 4096 bytes / 32768 bytes
+I/O size (minimum/optimal): 4096 bytes / 64 bytes

Very very strange. It seems like the number is in sectors (64 * 512 = 32768) rather than in bytes.

Quoted 8 lines

Disklabel type: dos
Disk identifier: <removed>

optimal < minimum ... is this a bug?

Where does this optimal iosize come from, scsi_debug module? Is there a commandline tool to get this iosize, maybe blkid?

Quoted 8 lines

cat /sys/block/sda/queue/{optimal,minimum}_io_size cat /sys/block/sda/queue/{physical,logical}_block_size

The optimal IO size is often 0 (in /sys) in this case libfdisk fallback to minimal IO size.

Try
LIBFDISK_DEBUG=all fdisk -l /dev/sda

Thx.

I get this on the "broken systems":

## sector_size=512

$ modprobe -r scsi_debug
$ modprobe scsi_debug dev_size_mb=100 sector_size=512
$ devname=$(grep --with-filename scsi_debug /sys/block/*/device/model | awk -F '/' '{print $4}')
$ cat /sys/block/$devname/queue/{logical_block_size,physical_block_size,minimum_io_size,optimal_io_size}
512
512
512
64

## sector_size=4096

$ modprobe -r scsi_debug
$ modprobe scsi_debug dev_size_mb=100 sector_size=4096
$ devname=$(grep --with-filename scsi_debug /sys/block/*/device/model | awk -F '/' '{print $4}') 
$ cat /sys/block/$devname/queue/{logical_block_size,physical_block_size,minimum_io_size,optimal_io_size}
4096
4096
4096
512

These odd optimal iosizes only happen for "scsi_debug" devices (not the loop nor md devices used in our test suite).

Reproduced on kernel 4.1.15 and 4.4.0.
Was correct on kernel 3.16.7 (and maybe even 4.1.13).

Maybe it's not only about the kernel version but also something about other host specific settings.

Could somebody please reproduce this on kernel 4.4.0?

cu,
Rudi

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Re: scsi_debug, iosize optimal < minimum (was: test sfdisk, optimal_iosize)

Hi,

I've noticed a possible problem with scsi_debug devices where optimal_io_size < minimum_io_size.

The problem seems reproducable with kernel 4.4.0 and also with stable version 4.1.15. For stable tree the last known working version is 4.1.13.

How to reproduce:

uname -mr
modprobe -r scsi_debug
modprobe scsi_debug dev_size_mb=100 sector_size=512
udevadm settle
devname=$(grep --with-filename scsi_debug /sys/block/*/device/model | awk -F '/' '{print $4}') cat /sys/block/$devname/queue/{minimum_io_size,optimal_io_size}
modprobe -r scsi_debug

## output kernel 4.1.13 (openSUSE Leap):
4.1.13-5-default x86_64
512
32768

## output kernel 4.1.15 (openSUSE Leap):
4.1.15-8-default x86_64
512
64

cu,
Rudi
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

Re: scsi_debug, iosize optimal < minimum

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ruediger" == Ruediger Meier <[email protected]> writes:

Ruediger> I've noticed a possible problem with scsi_debug devices where Ruediger> optimal_io_size < minimum_io_size.

Ruediger> The problem seems reproducable with kernel 4.4.0 and also with Ruediger> stable version 4.1.15. For stable tree the last known working Ruediger> version is 4.1.13.

http://git.kernel.org/cgit/linux/kernel/git/mkp/scsi.git/commit/?h=4.5/scsi-fixes&id=d0eb20a863ba7dc1d3f4b841639671f134560be2

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering

A message that is not in the archive (sent off-list or not yet received): yq1fuxcr5lk.fsf-+q57XtR/[email protected]

#8 lore raw

Re: scsi_debug, iosize optimal < minimum

Quoted 11 lines · Martin K. Petersen
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ruediger" == Ruediger Meier <[email protected]> writes:

Ruediger> I've noticed a possible problem with scsi_debug devices where Ruediger> optimal_io_size < minimum_io_size.

Ruediger> The problem seems reproducable with kernel 4.4.0 and also with Ruediger> stable version 4.1.15. For stable tree the last known working Ruediger> version is 4.1.13.

http://git.kernel.org/cgit/linux/kernel/git/mkp/scsi.git/commit/?h=4.
5/scsi-fixes&id=d0eb20a863ba7dc1d3f4b841639671f134560be2

Ah thanks!

But I'm still wondering a bit. Using kernel 4.5-rc2 (where 9c1d9c20 and d0eb20a8 is included) I get

$ getconf PAGESIZE
4096
$ modprobe scsi_debug
$  cat /sys/block/$devname/queue/{minimum_io_size,optimal_io_size}
512
524288

In past (kernel<=4.1) optimal_io_size io size was 32768. Is this really correct now?

cu,
Rudi
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw

Re: scsi_debug, iosize optimal < minimum

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ruediger" == Ruediger Meier <[email protected]> writes:

Ruediger> In past (kernel<=4.1) optimal_io_size io size was 32768. Is Ruediger> this really correct now?

We recently bumped the scsi_debug optimal I/O size to something akin to what real-world storage reports.

Signature · 5 lines
Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#11 lore raw

Re: scsi_debug, iosize optimal < minimum

Quoted 7 lines · Martin K. Petersen
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ruediger" == Ruediger Meier <[email protected]> writes:

Ruediger> In past (kernel<=4.1) optimal_io_size io size was 32768. Is Ruediger> this really correct now?

We recently bumped the scsi_debug optimal I/O size to something akin to what real-world storage reports.

Regarding these kernel changes I've send a pull request via github to fix the tests:
https://github.com/karelzak/util-linux/pull/272

cu,
Rudi