All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Eugen Rogoza" <euro123@gmx.net>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] Alignment issue with 4K disk
Date: Sun, 10 Jan 2016 21:20:37 +0100	[thread overview]
Message-ID: <trinity-418c2688-84c8-4fa1-8d47-ae284258ca08-1452457237226@3capp-gmx-bs52> (raw)
In-Reply-To: <5692AD3C.9070906@whgl.uni-frankfurt.de>

> Hi Eugen,
> 
> Quoting a document on IO-Hintig:
> 
> 'Storage vendors can also supply "I/O hints" about a device's preferred
> minimum unit for random I/O ('minimum_io_size') and streaming I/O
> ('optimal_io_size').  For example, these hints may correspond to a RAID
> device's chunk size and stripe size respectively.'
> 
> Of course a RAIDs layout parameters and preferred IO sizes are 
> semantically completely different things.
> 
> As for your case:
> Ignore the warning. I think the optimal IO size as in 'preferred size 
> for sequential streaming IO' is indeed correct and must not necessarily 
> be a multiple of physical sector size. The optimal IO size is owed to 
> the transport layer (USB protocol) constraints, to max out the BUS 
> bandwidth.
> 
> Cutting it down to a simple example:
> Consider each frame in the transport layer can hold 1.9 physical 
> sectors. Stuffing only 1 sector into the frame (to keep the multiple 
> physical sector constraint) will lead to a significant rise in number of 
> frames/packets and thus overhead. And I am not even talking about 
> transport layers with fixed frame size where you'll loose nearly 50% of 
> bandwidth and therefore transfer rate.
> 
> Anyway, in your case everything seems properly aligned. I tried to find 
> a way to influence 'optimal_io_size', could not find anything. Changing 
> the parameters via sysfs does not work, maybe there are IOCTLs and a 
> suiting utility...

Hi Sven,

thanks for the insights. If I understand the explanation correctly (and put into simpler words), the optimal_io_size is reported by USB enclosure, not by the device itself, thus confusing the device mapper layer and causing lsbkl to show misalignment (as the dm expects optimal_io_size to be multiples of physical block size). At the same time the enclosure is supposed to reassemble the sectors from the transport frames into aligned reads/writes to the physical device, thus theoretically causing no performance degradation.

Anyway, my particular issue seems to be resolved. Thanks for that again. Although it doesn't explain why a previous LUKS-container on the same partition of the same drive connected the same way didn't throw any warnings (let me redo this test to be sure).

Just a suggestion: if DM stacking tests are currently considered to be implemented in an optimal way, I would at least appreciate an additional hint somewhere in the messages that the warnings could be due to a transport layer like USB sitting in front of the physical drive, and that they could be ignored in this case.

Cheers,

Eugen

  reply	other threads:[~2016-01-10 20:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-10 17:22 [dm-crypt] Alignment issue with 4K disk Eugen Rogoza
2016-01-10 19:13 ` Sven Eschenberg
2016-01-10 20:20   ` Eugen Rogoza [this message]
2016-01-10 21:00     ` Sven Eschenberg
  -- strict thread matches above, loose matches on Subject: below --
2016-01-10 15:37 Eugen Rogoza
2016-01-10 15:18 Eugen Rogoza
2016-01-10  0:25 Eugen Rogoza
2016-01-10  1:14 ` Sven Eschenberg
2016-01-10  4:30   ` Sven Eschenberg
2016-01-04 21:31 Yves-Alexis Perez
2016-01-04 21:54 ` Sven Eschenberg
2016-01-04 22:20   ` Yves-Alexis Perez
2016-01-04 22:41     ` Sven Eschenberg
2016-01-04 23:02     ` Sven Eschenberg
2016-01-05 10:14       ` Yves-Alexis Perez
2016-01-07 18:00         ` .. ink ..
2016-01-09 12:30           ` Milan Broz
2016-01-09 14:47             ` Sven Eschenberg

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=trinity-418c2688-84c8-4fa1-8d47-ae284258ca08-1452457237226@3capp-gmx-bs52 \
    --to=euro123@gmx.net \
    --cc=dm-crypt@saout.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.