Move FlushProcessWriteBuffers to minipal#118161
Conversation
Implements dotnet#117977 Also move the initialization of it and get of page size
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
|
Thoughts about switching Mono to this implementation too? The current Mono implementation does not look 100% reliable. It does not lock the memory in place, etc. LGTM otherwise |
There was a problem hiding this comment.
Pull Request Overview
This PR implements the migration of FlushProcessWriteBuffers functionality from PAL to the minipal library. The change centralizes memory barrier operations across process-wide threads into a reusable minipal component, removing platform-specific implementations scattered throughout the runtime.
Key changes:
- Creates new minipal memory barrier API with initialization and execution functions
- Removes existing FlushProcessWriteBuffers implementations from PAL and runtime components
- Updates all call sites to use the new minipal API
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/minipal/memorybarrierprocesswide.h | New header defining minipal memory barrier API |
| src/native/minipal/memorybarrierprocesswide.c | Implementation of cross-platform memory barrier functionality |
| src/native/minipal/CMakeLists.txt | Adds new source file to minipal build |
| src/coreclr/vm/*.cpp | Updates call sites to use minipal API instead of FlushProcessWriteBuffers |
| src/coreclr/pal/src/thread/process.cpp | Removes old FlushProcessWriteBuffers implementation |
| src/coreclr/pal/src/init/pal.cpp | Updates initialization to use minipal function |
| src/coreclr/pal/src/include/pal/process.h | Removes old function declaration |
| src/coreclr/pal/inc/pal.h | Removes FlushProcessWriteBuffers export |
| src/coreclr/nativeaot/Runtime/*.cpp | Updates NativeAOT runtime to use minipal API |
| src/coreclr/gc/*.cpp | Updates GC components to use minipal API |
I have opened sub-issue for it and we can try it in a followup PR #118834 |
|
/backport to release/10.0 |
|
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17152675956 |
|
|
Implements #117977
Also move the initialization of it and get of page size