[Parted-maintainers] Bug#923561: parted: Incorrect optimal alignment for USB device

Phillip Susi phill at thesusis.net
Mon Mar 4 18:42:06 GMT 2019


On 3/4/2019 11:50 AM, Kevin Locke wrote:
> optimal_io_size is defined in the kernel ABI[1] as "the preferred
> request size for workloads where sustained throughput is desired".  In
> this case, I think it comes from scsi_disk.opt_xfer_blocks[2] which
> comes from the VPD block limits page[3] which my disk reports as 65535
> blocks (according to sg_vpd).

Yes, I was looking over the definition earlier in the kernel
documentation, and it seems to me that part of the definition indicates
it is simply an optimal size to transfer in, and has nothing to do with
alignment.  But parted treats it as having to do with alignment, because
the same kernel documentation mentions that is what the md driver uses
the field for.

> The definition seems reasonable, but it would not surprise me if 65535
> were bogus.  I am not familiar enough with USB+UAS to know if this
> might be an optimal size for the protocols involved.  I can raise the
> issue on linux-scsi/linux-usb.

I think the issue needs raised in a few places; I just couldn't decide
where.

> However, whether or not this is changed in the kernel, I would argue
> it should be handled in parted.  Both to support previous+current
> kernels and because I think the optimal_io_size ABI definition allows
> optimal_io_size which is not a multiple of minimum_io_size for
> transports where that truly is the case.

Unfortunately, that means parted needs to simply ignore the value of
optimal io size as totally meaningless garbage, and I don't much like
the thought of that.  If parted has always been wrong and the intended
meaning of the kernel parameter has never had anything to do with
alignment, then yes, parted needs to ignore it because it read meaning
into it that was never intended.  But if it is supposed to have
something to do with optimal alignment, then md is right and usb is
wrong, and usb needs to be fixed.



More information about the Parted-maintainers mailing list