Repository navigation
Add memoryPageSize configuration and WSLC backing-page opt-in - #42110
Ben Hillis (benhillis) wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Overlapping release checks newly enable small pages on Cobalt hosts below the required fix threshold, exposing unflagged WSLC sessions to the partition-teardown deadlock.
1 open issue
What changed in this PR
Adds disabled-by-default support for 2 MiB host backing pages in WSL2 and WSLC, with shared HCS configuration and a runtime-version check for C SDK callers.
Changes:
- Adds the experimental
.wslconfigsetting and independent WSLC C/COM feature flags. - Centralizes backing-page policy and adds localized SDK diagnostics for unsupported runtime versions.
- Adds helper and integration tests plus configuration and API documentation.
| File | Description |
|---|---|
test/windows/wslc/WSLCTests.cpp |
Tests the COM opt-in and updates default-policy expectations. |
test/windows/wslc/WslcSdkTests.cpp |
Tests session creation with the C SDK flag. |
test/windows/wsl/UnitTests.cpp |
Tests configuration values and page-reporting settings. |
test/windows/common/MemoryBackingPagesTests.cpp |
Adds helper and runtime-version tests. |
src/windows/WslcSDK/WslcsdkPrivate.h |
Adds runtime-version validation and diagnostics. |
src/windows/WslcSDK/wslcsdk.h |
Exposes the C SDK feature flag. |
src/windows/WslcSDK/wslcsdk.cpp |
Accepts the flag and checks runtime support. |
src/windows/service/inc/WSLCShared.idl |
Defines and validates the COM feature flag. |
src/windows/service/exe/WslCoreVm.cpp |
Applies shared backing-page configuration to WSL2. |
src/windows/service/exe/HcsVirtualMachine.cpp |
Applies shared backing-page configuration to WSLC. |
src/windows/common/WslCoreConfig.h |
Defines the disabled-by-default setting and tracing field. |
src/windows/common/WslCoreConfig.cpp |
Parses the experimental setting. |
src/windows/common/hcs.hpp |
Declares the shared memory-policy helper. |
src/windows/common/hcs.cpp |
Implements backing-page and page-reporting policy. |
src/windows/common/hcs_schema.h |
Adds large-page JSON serialization support. |
localization/strings/en-US/Resources.resw |
Adds setting text and runtime-version diagnostics. |
doc/docs/technical-documentation/wslservice.exe.md |
Documents configuration, tradeoffs, and WSLC usage. |
doc/docs/api-reference/c/session-apis/wslcsetsessionsettingsfeatureflags.md |
Explains when runtime validation occurs. |
doc/docs/api-reference/c/session-apis/wslccreatesession.md |
Documents unsupported-runtime errors. |
doc/docs/api-reference/c/enumerations/wslcsessionfeatureflags.md |
Documents the new flag and requirements. |
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Windows integration validation is still needed for HCS large-page allocation, VM creation and teardown in both paths, changed WSLC defaults on older hosts, and older-runtime rejection through the live SDK/COM path.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Windows integration testing is still needed to validate actual HCS large-page allocation, live SDK rejection of older runtimes, and the changed default WSLC backing-page policy on older hosts.
No open issues 🎉
Review effort: Balanced
fc0298f to
db18759
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The host backing-page and default WSLC policy changes still require live Windows/HCS validation of VM creation and teardown, actual large-page allocation, and SDK/COM rejection on older Windows runtimes.
No open issues 🎉
Review effort: Balanced
|
Naming wise I think instead of |
When presented with two options "default" and "performance" why would somebody ever choose default? I think the setting should reflect the tradeoffs. |
True. Perhaps Or Pierre's approach of My vote in order would be:
Blue (@OneBlue) what are your thoughts here? |
Add one minimum-version constant, localized runtime-update diagnostic, and isolated boundary tests for newly introduced SDK features. Preserve matching development-runtime support without changing existing feature compatibility. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c41a7ed8-95e1-43b6-adb5-b4e50c9dbff8
Expose experimental.largeMemoryBackingPages and WSLC session feature flags. Share HCS memory configuration and require WSL 3.1.0 for the new C SDK flag, with a matching development-runtime exception. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c41a7ed8-95e1-43b6-adb5-b4e50c9dbff8
Prevent newer Windows releases from falling through an older release's update revision threshold. Add boundary coverage and share the capability predicate with memory-policy tests while retaining host detection inside the configuration helper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c41a7ed8-95e1-43b6-adb5-b4e50c9dbff8
Use feature bit 0x80 so nested virtualization can retain 0x40. Reuse shared runtime-version tests, minimum version, and localization without duplicate resources. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c41a7ed8-95e1-43b6-adb5-b4e50c9dbff8
Expose density and performance profiles while preserving the existing memory policy and default. Update documentation, localization, and configuration tests; leave WSLC feature flags unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbfcc7c8-242a-4d82-b768-0318e2c4fb78
Use small for the existing default and medium for 2 MiB backing pages. Reserve large for future support, rejecting it with the existing invalid-value warning for now. Update parsing, live VM tests, and developer documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9d91a4a8-bfd7-4045-89e0-5c70623c0247
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9d91a4a8-bfd7-4045-89e0-5c70623c0247
da45dee to
8375e99
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9d91a4a8-bfd7-4045-89e0-5c70623c0247
There was a problem hiding this comment.
🔵 Needs a closer look
Maintainer confirmation is needed for the VID teardown-fix build/UBR thresholds before defaulting additional pre-26100 WSLC hosts to small backing pages, since the tests do not independently establish teardown safety across supported servicing branches.
No open issues 🎉
1 resolved since last review
Review effort: Balanced


Summary of the Pull Request
Add opt-in 2 MiB host backing pages for WSL2 and WSLC.
PR Checklist
Detailed Description of the Pull Request / Additional comments
smallis the default;mediumrequests 2 MiB backing pages.largeis reserved for future support and currently rejected. Runwsl --shutdownto apply changes.WSLC sessions opt in independently through C SDK and COM feature flags.
Validation Steps Performed
cmake --build . -- -m- passed..\FormatSource.ps1 -Branch -BaseBranch origin/master -Verify $true- passed.