build_image tune right-size image
To more quickly settle on a no free space result, recognize that there is roughly 1/58.5 overhead managing the free space pool as determined experimentally. This algorithm carries with it some risk of being sensitive to any alterations in ext4. This also addresses the issue of a much larger apparent free space available calculated on the sample pass when deploying ext4 dedupe, and resolves the poorer estimation that happens without accounting for the overhead. The alternative of adding a second pass works to a similar, and likely more comforting algorithm and result. But doing so adds a minute to the typical incremental build time, or +50% to the time it takes to determine ext4 right sized images. Test: manual Bug: 111302946 Change-Id: Id5ae6645b9aa2d036e6fefe2fb17672e8f8ef6f0
This commit is contained in:
parent
89fe71180b
commit
c3d408e3c1
1 changed files with 1 additions and 1 deletions
|
@ -297,7 +297,7 @@ def BuildImage(in_dir, prop_dict, out_file, target_out=None):
|
|||
logger.info(
|
||||
"Not worth reducing image %d <= %d.", free_size, reserved_size)
|
||||
else:
|
||||
size -= free_size
|
||||
size -= free_size + (free_size // 59)
|
||||
size += reserved_size
|
||||
if block_size <= 4096:
|
||||
size = common.RoundUpTo4K(size)
|
||||
|
|
Loading…
Reference in a new issue