Commit 831466a
util: optimize key rotation flow for cryptsetup
This patch adds the missing memory limits to cryptsetup `AddKey`.
If this limit is missing `cryptsetup` will determine its own limits
in order to satisfy the KDF, which can lead to serious resource
contentions, IOW, more power the system has, more resources will be
used (this is intentional).
`Open` and `RemoveKey` use the memory limits(set when format/adding) from
the existing headers on the device and hence do not require manual limits.
A limit on active threads is also enforced to run KDF on a single
thread, reducing CPU contention when a lot of processes are active
at the same time.
Additionally, use the `--test-passphrase` with `open` for verification
instead of calling `changeKey` with same passphrase to save
on unnecessary derivations and disk IO (test-passphrase is read only).
Signed-off-by: Niraj Yadav <niryadav@redhat.com>1 parent c925e81 commit 831466a
1 file changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
580 | 584 | | |
581 | 585 | | |
582 | 586 | | |
| 587 | + | |
| 588 | + | |
583 | 589 | | |
584 | 590 | | |
585 | 591 | | |
| |||
635 | 641 | | |
636 | 642 | | |
637 | 643 | | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
638 | 648 | | |
639 | 649 | | |
640 | 650 | | |
| |||
720 | 730 | | |
721 | 731 | | |
722 | 732 | | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
723 | 736 | | |
724 | 737 | | |
725 | 738 | | |
726 | 739 | | |
727 | 740 | | |
728 | | - | |
| 741 | + | |
| 742 | + | |
729 | 743 | | |
730 | | - | |
731 | 744 | | |
732 | 745 | | |
733 | 746 | | |
| |||
0 commit comments