LATX, opt: Reduce AOT page-load link capacity - #340
Draft
LaurenIsACoder wants to merge 4 commits into
Draft
Conversation
when loading by page, the total number of aot_global_info_total entries is typically not large, so setting the initial capacity to 512 is more appropriate. Signed-off-by: Wenqiang Wei <weiwenqiang@mail.ustc.edu.cn>
The page-loading path used 128 entries even though the optimization specifies an initial capacity of 512. The capacity selection also encoded the load-all mode and both sizes as magic numbers. Name the AOT mode and capacities, use 512 for page loading, and retain 100000 entries for load-all mode. Test: source consistency check verifies page=512 and segment=100000. Signed-off-by: Hanlu Li <heuleehanlu@gmail.com>
Reducing the initial link-table capacity makes dynamic growth a normal path. The table used signed counters, shifted the capacity without an overflow guard, and assigned realloc directly back to the only pointer. Use size_t counters, typed GLib allocation, and reject capacity overflow before doubling. Test: strict checkpatch and source guard checks; LoongArch growth/build validation follows. Signed-off-by: Hanlu Li <heuleehanlu@gmail.com>
Signed-off-by: Hanlu Li <heuleehanlu@gmail.com>
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.
Summary
Review fixes
The original patch was corrected during review:
size_tfor capacities and indicesg_try_renew()and skip additional AOT links on growth failure, preserving the old allocation and capacityValidation
Validated on LoongArch host
l1at06965c246dc431a01651ab6598784565b68c71f8:latx-x86_64target build: PASS (397/397 on initial build)sizeof(aot_link_info) == 24: page-mode initial allocation drops from 2,400,000 bytes to 12,288 bytes[], full build PASSMac-side final checks:
checkpatch.pl --strict: 0 errors, 0 warningsgit diff --check: clean