partially_populate_device: align span positions to block size for better performance - #509
Merged
Merged
Conversation
This was referenced Apr 29, 2026
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
3 times, most recently
from
May 1, 2026 12:09
cd4e983 to
5b46ad7
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
from
May 11, 2026 15:48
0a82603 to
b73bcc9
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 11, 2026 15:49
5b46ad7 to
03aaba9
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
from
May 12, 2026 13:16
b73bcc9 to
5df0dc2
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 12, 2026 13:16
03aaba9 to
2039225
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
from
May 12, 2026 13:23
5df0dc2 to
ff50780
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 12, 2026 13:23
2039225 to
9f79300
Compare
Millefeuille42
approved these changes
May 13, 2026
| expected_flags = f'--expected-checksum {self.checksum}' if self.checksum is not None else '' | ||
| randstream(vm, f'validate {expected_flags} --position {self.position} --size {self.size} {dev}') | ||
|
|
||
| def compute_span_layout(dev_size: int, total_size: int, num_spans: int, align: int) -> list[tuple[int, int]]: |
Contributor
There was a problem hiding this comment.
I'd rather have the argument called block_size. Align makes it ambiguous whether it's a flag or a value.
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 13, 2026 13:56
34456d1 to
81137d3
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
from
May 13, 2026 13:58
c70e171 to
fbb8227
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
2 times, most recently
from
May 18, 2026 16:22
9d503d2 to
d05f1ec
Compare
stormi
reviewed
May 18, 2026
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 19, 2026 15:29
d05f1ec to
8fe8f4a
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
from
May 19, 2026 15:29
3e8fe23 to
44d95e4
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 19, 2026 15:31
8fe8f4a to
c538815
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
from
May 19, 2026 15:55
44d95e4 to
c097695
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 19, 2026 15:55
c538815 to
4eb8490
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
from
May 20, 2026 19:02
c097695 to
937fa6d
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 20, 2026 19:02
4eb8490 to
0da90f0
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
from
May 21, 2026 13:43
937fa6d to
27533d0
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
2 times, most recently
from
May 21, 2026 14:07
2308266 to
84d7873
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
2 times, most recently
from
May 21, 2026 14:16
2a7ce58 to
4ca7988
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 21, 2026 14:16
84d7873 to
7f13042
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
from
May 21, 2026 14:29
4ca7988 to
ce36044
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 21, 2026 14:29
7f13042 to
7d3fc3e
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
from
May 22, 2026 15:29
ce36044 to
ff961ea
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 22, 2026 15:29
7d3fc3e to
b88f1f8
Compare
glehmann
force-pushed
the
gln/add-max-volume-size-constants-npxp
branch
from
May 29, 2026 11:37
ff961ea to
b882ed3
Compare
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
May 29, 2026 11:37
b88f1f8 to
597a422
Compare
…ter performance Add an optional `align` parameter (default: 1) to align span positions to a given block size. Only positions are aligned (rounded down); span sizes are reduced if needed to avoid overlapping the next span's position. When config.write_volume_cap is large enough, spans are contiguous and cover the full device with no gaps. Without alignment, write throughput drops from ~700MiB/s to ~200MiB/s on large disks. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
glehmann
force-pushed
the
gln/align-spans-to-block-size-rupt
branch
from
June 1, 2026 08:48
597a422 to
5076ce0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an optional
alignparameter (default: 4KiB) to align span positionsto a given block size. Only positions are aligned (rounded down); span sizes
are reduced if needed to avoid overlapping the next span's position. When
config.write_volume_cap is large enough, spans are contiguous and cover the
full device with no gaps. Without alignment, write throughput drops from
~700MiB/s to ~200MiB/s on large disks.
This PR is part of a tree containing 19 PRs:
mastermaster