Skip to content

statically linking GC PAL on linux - #76985

Merged
mangod9 merged 13 commits into
dotnet:mainfrom
mangod9:use_gc_pal
Oct 25, 2022
Merged

statically linking GC PAL on linux#76985
mangod9 merged 13 commits into
dotnet:mainfrom
mangod9:use_gc_pal

Conversation

@mangod9

Copy link
Copy Markdown
Member

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
@mangod9mangod9 added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) area-GC-coreclr labels Oct 13, 2022
@ghostghost assigned mangod9Oct 13, 2022
@ghost

Copy link
Copy Markdown

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:-

Comment threadsrc/coreclr/gc/unix/gcenv.unix.cpp Outdated
@janvorli

Copy link
Copy Markdown
Member

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

Comment threadsrc/coreclr/gc/unix/gcenv.unix.cpp Outdated
Comment threadsrc/coreclr/gc/unix/gcenv.unix.cpp Outdated
Comment threadsrc/coreclr/gc/unix/gcenv.unix.cpp Outdated
goto CLEANUP15;
}

if (FALSE == NUMASupportInitialize())

Copy link
Copy Markdown
MemberAuthor

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.

Comment threadsrc/coreclr/pal/src/CMakeLists.txt
#ifdef HOST_WINDOWS

//******************************************************************************
// NumaNodeInfo

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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.

@jkotasjkotasOct 17, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

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

@mangod9mangod9 changed the title [WIP] statically linking GC PALstatically linking GC PALOct 17, 2022
@mangod9
mangod9 requested a review from Maoni0October 17, 2022 17:12
@mangod9mangod9 removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Oct 17, 2022
@mangod9mangod9 changed the title statically linking GC PALstatically linking GC PAL on linuxOct 17, 2022
Comment threadsrc/coreclr/gc/unix/gcenv.unix.cpp Outdated
Comment threadsrc/coreclr/gc/unix/gcenv.unix.cpp
Comment threadsrc/coreclr/gc/unix/gcenv.unix.cpp Outdated
@janvorli
janvorliforce-pushed the use_gc_pal branch 2 times, most recently from 263a2f0 to dccc8c6CompareOctober 19, 2022 22:09
@mangod9

Copy link
Copy Markdown
MemberAuthor

/azp run runtime

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment threadsrc/coreclr/gc/unix/gcenv.unix.cpp Outdated
Comment threadsrc/coreclr/gc/unix/gcenv.unix.cpp Outdated
Comment threadsrc/coreclr/gc/unix/gcenv.unix.cpp Outdated
@mangod9
mangod9 requested a review from Maoni0October 25, 2022 18:02

@Maoni0Maoni0 left a comment

Copy link
Copy Markdown
Member

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:mainOct 25, 2022
@EgorBoEgorBo mentioned this pull request Oct 27, 2022
@EgorBo

Copy link
Copy Markdown
Member

@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
Copy Markdown
MemberAuthor

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.
@ghostghost locked as resolved and limited conversation to collaborators Nov 27, 2022
@sebastienros

Copy link
Copy Markdown
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
Copy Markdown
Member

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 freeto 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

@mangod9@janvorli@EgorBo@sebastienros@jkotas@am11@Maoni0