* [dm-crypt] dm-crypt perf related changes and cryptsetup LUKS format failing
@ 2014-02-07 13:53 Redwood Hyd
2014-02-07 14:42 ` Milan Broz
0 siblings, 1 reply; 2+ messages in thread
From: Redwood Hyd @ 2014-02-07 13:53 UTC (permalink / raw)
To: dm-crypt
Hi All ,
I did an experimental kernel change in linux/drivers/md/dm-crypt.c for
improving crypto HW performance.
Here is brief of it
static void crypt_io_hints(struct dm_target *ti,
struct queue_limits *limits)
{
limits->physical_block_size = 32768;
blk_limits_io_min(limits, 32768);
blk_limits_io_opt(limits, 32768);
}
It works (passed iozone -a, robocopy from samba client) and doubled
performance of dm-crypt WRITES !
Problem -
After above change cryptsetup luks format started failing disk
validations so additionally in
Cryptsetup-1.1.3 I did following changes to pass disk validation:
========================================================
/* Change-1 to overcome validation failure from dm-table.c that
"adding target device caused an alignment inconsistency" */
#define LUKS_STRIPES increased from 4000 to 524288
/* Change-2 to overcome validation failure in dm-table.c
"device-mapper: table: 253:1 start=8 not aligned to h/w logical block
size 32768 of dm-0" */
#define LUKS_ALIGN_KEYSLOTS increased from 4096 to 32768
/* Change-3 Additionally did following change */
#define DEFAULT_ALIGNMENT increased from 4096 to 32768
Question - Can someone recommend any later version of cryptsetup
package where I don't need to change
cryptsetup and luks format can still pass
validate_hardware_logical_block_alignment() in dm-table.c for 32k
encrypt block device ?
Performance related changes are experimental - If someone can suggest
things around this I will post my results to forum.
Regards and Thanks in advance
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dm-crypt] dm-crypt perf related changes and cryptsetup LUKS format failing
2014-02-07 13:53 [dm-crypt] dm-crypt perf related changes and cryptsetup LUKS format failing Redwood Hyd
@ 2014-02-07 14:42 ` Milan Broz
0 siblings, 0 replies; 2+ messages in thread
From: Milan Broz @ 2014-02-07 14:42 UTC (permalink / raw)
To: Redwood Hyd, dm-crypt
On 02/07/2014 02:53 PM, Redwood Hyd wrote:
> Hi All ,
>
> I did an experimental kernel change in linux/drivers/md/dm-crypt.c for
> improving crypto HW performance.
> Here is brief of it
> static void crypt_io_hints(struct dm_target *ti,
> struct queue_limits *limits)
> {
> limits->physical_block_size = 32768;
> blk_limits_io_min(limits, 32768);
> blk_limits_io_opt(limits, 32768);
> }
>
> It works (passed iozone -a, robocopy from samba client) and doubled
> performance of dm-crypt WRITES !
Well, increasing encryption block size was discussed several times.
Please search archive, e.g. here is some patch which increased block size:
http://thread.gmane.org/gmane.linux.kernel.device-mapper.dm-crypt/6441/focus=6587
(yes, your patch is just modification of io limits, which is simpler but has some
side effects - random io read/write will be worse I guess)
> Problem -
> After above change cryptsetup luks format started failing disk
> validations so additionally in
> Cryptsetup-1.1.3 I did following changes to pass disk validation:
Why are you using version released 4 years ago? :)
Try recent 1.6.3. It works without changes.
(Btw your changes to cryptsetup are not correct, it will just paperback over
real problem and cause LUKS format incompatibility.)
Actually, this is what I see after you patch (x is activated LUKS device):
# lsblk -t /dev/sdb
NAME ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE RA WSAME
sdb 0 512 0 512 512 1 cfq 128 128 32M
`-x 0 32768 32768 32768 512 1 128 128 0B
# lsblk -f /dev/sdb
NAME FSTYPE LABEL UUID MOUNTPOINT
sdb crypto_LUKS fc534366-6be5-46f3-9349-44dbe47f4b80
`-x ext4 6dfa13d0-2d0e-4955-a5c4-bd0848b07b47 /mnt/tst
so IO limits works...
Milan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-07 14:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-07 13:53 [dm-crypt] dm-crypt perf related changes and cryptsetup LUKS format failing Redwood Hyd
2014-02-07 14:42 ` Milan Broz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox