Skip to content

Conversation

@t-mustafin
Copy link
Contributor

@t-mustafin t-mustafin commented May 12, 2025

PR includes initial fixes GC with USE_REGIONS enabled for arm32.

Tests failed cause enabling USE_REGIONS on arm32 on Checked, fixed by this PR:

GC/API/GC/GetGCMemoryInfo/GetGCMemoryInfo
GC/Scenarios/Boxing/simpvariant/simpvariant

Tests failed cause enabling USE_REGIONS on arm32 on Checked, not fixed yet by this PR:

GC/API/NoGCRegion/Callback_Svr/Callback_Svr
GC/Features/HeapExpansion/plug/plug
JIT/jit64/opt/cse/hugeexpr1/hugeexpr1
readytorun/coreroot_determinism/coreroot_determinism/coreroot_determinism

cc @gbalykov

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label May 12, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

@t-mustafin t-mustafin force-pushed the main_USE_REGIONS_for_32_bit branch from 71745f0 to d1909db Compare June 5, 2025 13:57
@t-mustafin t-mustafin force-pushed the main_USE_REGIONS_for_32_bit branch from d1909db to 669b632 Compare June 5, 2025 14:09
@t-mustafin t-mustafin force-pushed the main_USE_REGIONS_for_32_bit branch from 669b632 to fdaf37c Compare June 5, 2025 14:41
@gbalykov
Copy link
Member

gbalykov commented Jun 9, 2025

@dotnet/gc can you please take a look? This set of changes is required for regions on 32bit.

With this PR on armel (with regions additionally enabled) there're no regressions on coreclr tests (checked default, release default/gcstress0xc/jitstress0x2/jitstress0x2, with crossgen of all tests/libs, etc). This was checked for WKS both with and without bgc (PR description is a bit outdated now).

This PR also fixes some logic for all arches for disabled bgc and total_allowed_soh_allocation calculation. Regions are not enabled by default here intentionally, this PR just fixes bugs. DATAS for 32bit requires additional work, so disabled for now.

cc @dotnet/samsung

@mangod9
Copy link
Member

mangod9 commented Jun 10, 2025

Do you have any metrics / perf numbers where you expect regions would help in a 32bit scenarios?

@dotnet-policy-service
Copy link
Contributor

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@gbalykov
Copy link
Member

Do you have any metrics / perf numbers where you expect regions would help in a 32bit scenarios?

@mangod9 sorry for late response. We are currently testing different scenarios, I'll share if there's any improvement. However, GC regions also provide additional functionality which is not present with segments, like heap hard limit and refresh of it. There's #101024, but it doesn't enable refresh of hard limit on 32bit with segments. Also, 32bit support in GC regions allows potential unification in future, when segments might be not needed at all and can potentially be removed.

@jkotas
Copy link
Member

jkotas commented Jul 13, 2025

Regions are based on the premise that virtual address space reservation is free. It is not the case on 32-bit platforms. 32-bit address space is precious and fragmented. Regions on 32-bit platforms would require per-application configuration on how much to reserve upfront. It would be severe user experience regression on 32-bit platforms.

@gbalykov
Copy link
Member

Regions on 32-bit platforms would require per-application configuration on how much to reserve upfront. It would be severe user experience regression on 32-bit platforms.

I agree that for general-purpose scenarios this might be less convenient, that's why this PR doesn't enable regions by default on 32bit and only focuses on bug fixing and support. However, this can be useful for scenarios with custom builds of runtime, when users can configure per-app reserve size.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-GC-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants