Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

statically linking GC PAL on linux #76985

Merged
merged 13 commits into from
Oct 25, 2022
Merged

statically linking GC PAL on linux #76985

merged 13 commits into from
Oct 25, 2022

Conversation

mangod9
Copy link
Member

@mangod9 mangod9 commented Oct 13, 2022

The GC PAL will be used for both coreclr and standalone GC on linux. FIxes #72684.

Have validated that it reduces the working set for unbounded memory limits by ~70mb for a vanilla webapi app.

The GC PAL will be used for both coreclr and standalone GC on linux
@mangod9 mangod9 added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) area-GC-coreclr labels Oct 13, 2022
@ghost ghost assigned mangod9 Oct 13, 2022
@ghost
Copy link

ghost commented Oct 13, 2022

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

Issue Details

The GC PAL will be used for both coreclr and standalone GC on linux. FIxes #72684.

Have validated that it reduces the working set for unbounded memory limits by ~70mb for a vanilla webapi app.

Author: mangod9
Assignees: -
Labels:

NO-MERGE, area-GC-coreclr

Milestone: -

@janvorli
Copy link
Member

@mangod9 I would make the change for all OSes, not just Unix.

@@ -673,13 +673,6 @@ Initialize(
goto CLEANUP15;
}

if (FALSE == NUMASupportInitialize())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assume its fine to remove the Numa initialization from the pal, since its now being handled with the gc_unix pal.

@@ -513,6 +513,8 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr,
return pResult;
}

#ifdef HOST_WINDOWS

//******************************************************************************
// NumaNodeInfo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete the NumaNodeInfo class?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah guess there is more cleanup required here, will do as part of a separate PR.

Copy link
Member

@jkotas jkotas Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you are keeping the VM version of the current PAL for Windows under ifdefs. Is there a problem with using the GC PAL on Windows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there shouldnt be an issue with moving windows too, just needs a some more wrangling. Also need to check with @Maoni0 that all numa stuff is handled appropriately in gcenv.windows

@mangod9 mangod9 changed the title [WIP] statically linking GC PAL statically linking GC PAL Oct 17, 2022
@mangod9 mangod9 requested a review from Maoni0 October 17, 2022 17:12
@mangod9 mangod9 removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Oct 17, 2022
@mangod9 mangod9 changed the title statically linking GC PAL statically linking GC PAL on linux Oct 17, 2022
@mangod9
Copy link
Member Author

mangod9 commented Oct 19, 2022

/azp run runtime

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mangod9 mangod9 requested a review from Maoni0 October 25, 2022 18:02
Copy link
Member

@Maoni0 Maoni0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mangod9 mangod9 merged commit c4341d4 into dotnet:main Oct 25, 2022
@EgorBo EgorBo mentioned this pull request Oct 27, 2022
@EgorBo
Copy link
Member

EgorBo commented Oct 27, 2022

@mangod9 Could this decrease working set in TE benchmarks (only on Linux)?

e.g.
image

it's something from this range: ee41716...7b5ab35

@mangod9
Copy link
Member Author

mangod9 commented Oct 27, 2022

yeah, that was one of the main reasons for the change.

mangod9 added a commit to mangod9/runtime that referenced this pull request Nov 10, 2022
* statically linking GC PAL

The GC PAL will be used for both coreclr and standalone GC on linux

* fixing arm64 and nativeaot build breaks

* macos build break and reducing renaming.

* trying to remove numa support from PAL

* one more rename to resolve MacOS break

* delete pal numa code.

* Adding missing madvise in GC PAL

* added missing MADV_DONTDUMP calls.

* CR feedback

* undo (long long) cast in GetMemoryStatus

* only invoke madvise on success.
mangod9 added a commit to mangod9/runtime that referenced this pull request Nov 24, 2022
* statically linking GC PAL

The GC PAL will be used for both coreclr and standalone GC on linux

* fixing arm64 and nativeaot build breaks

* macos build break and reducing renaming.

* trying to remove numa support from PAL

* one more rename to resolve MacOS break

* delete pal numa code.

* Adding missing madvise in GC PAL

* added missing MADV_DONTDUMP calls.

* CR feedback

* undo (long long) cast in GetMemoryStatus

* only invoke madvise on success.
@ghost ghost locked as resolved and limited conversation to collaborators Nov 27, 2022
@sebastienros
Copy link
Member

Is it possible that it also improved the startup time? Many benchmarks saw an improvement on the same changeset containing this PR.

image

@jkotas
Copy link
Member

jkotas commented Feb 13, 2023

Is it possible that it also improved the startup time?

Yes, the PAL did a bunch of extra useless work before this change.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use custom GC PAL for all GC build flavors
7 participants