Hello, On 22/07/2009 Milan Broz wrote: > Jonas Meurer wrote: > > i just did some benchmarking regarding the speed of luksOpen, as i have > > the impression that it sometimes takes really long. > > possible reasons are: > 1) every test for keyslot create new temporary device, > it generates new device events and if udev rules are wrong, > it will scan these devices (with udevsettle in 1.0.6 this was disaster) > > 2) it takes some time to check that key is wrong > > 3) keyfile direct read is not optimal > > I have already idea, that it could be done in one step > (all 8 slot mapped at once, just create 8 segment dm-crypt device, > just fiddling with initial IV sector for segments, then it is just > reads of one device without additional uevents + ioctls). > > I added function to libdevmapper to easily setup crypt segment, but > using that will make cryptsetup dependent on recent libdevmapper. great news! but i guess that you at least have to verify that differnt keyslots don't have similar keys. otherwise you would get two success returns in case that all slots are checked at once. > But anyway, first try to run it with disabled udev, device nodes > for cryptsetup are not created by udev, so test should work:-) i'll do that tomorrow in case that i do have the time. > > it is obvious that the time luksOpen takes is related to the keysize. > > > > but for some non-obvious reason it is neither proportional nor inverse > > proportional related to size. > > instead there seem to be keyfile sizes which cryptsetup is able to > > process a lot faster than others. especially 128k seems to be a very > > good size for key files. > > There is already patch to optimize direct reads, so probably it is time > to test if that helps. do you have a link to the patch? i could give it a try. > Please can you create issue on project pages with the tests above to not > forget about this? done: http://code.google.com/p/cryptsetup/issues/detail?id=25 thanks for your great work, Milan! greetings, jonas
Attachment:
signature.asc
Description: Digital signature