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

Support Thread Affinity for Execution Config #4614

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

nibanks
Copy link
Member

@nibanks nibanks commented Oct 15, 2024

Description

Adds another execution config knob for setting affinitizing threads to their CPU.

Testing

CI/CD

Documentation

N/A

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 86.79%. Comparing base (fd0adfd) to head (5cd7cc0).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/core/worker.c 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4614      +/-   ##
==========================================
- Coverage   87.27%   86.79%   -0.48%     
==========================================
  Files          56       56              
  Lines       17354    17357       +3     
==========================================
- Hits        15145    15065      -80     
- Misses       2209     2292      +83     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -272,6 +272,7 @@ typedef enum QUIC_EXECUTION_CONFIG_FLAGS {
QUIC_EXECUTION_CONFIG_FLAG_XDP = 0x0004,
QUIC_EXECUTION_CONFIG_FLAG_NO_IDEAL_PROC = 0x0008,
QUIC_EXECUTION_CONFIG_FLAG_HIGH_PRIORITY = 0x0010,
QUIC_EXECUTION_CONFIG_FLAG_AFFINITIZE = 0x0020,
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, this should indicate what the threads are being affinitized to - NUMA node, single RSS CPU, something else?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer to just leverage documentation for what, which is currently being deferred since these are all prototype features. I just want to get this in so our partners can experiment. If it doesn't actually help, it might ultimately be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Generally speaking, I think even experimental features should be designed as if they will be retained, because it is difficult to remove/rename existing dependencies. That said, I'm ok with unblocking folks here.

ThreadFlags |= CXPLAT_THREAD_FLAG_HIGH_PRIORITY;
}
if (MsQuicLib.ExecutionConfig->Flags & QUIC_EXECUTION_CONFIG_FLAG_AFFINITIZE) {
ThreadFlags |= CXPLAT_THREAD_FLAG_SET_AFFINITIZE;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like just adding flag? where is the actual logic?

Copy link
Member Author

Choose a reason for hiding this comment

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

The logic was already implemented elsewhere. This is just a new config flag.

@nibanks nibanks merged commit 709d700 into main Nov 6, 2024
478 of 481 checks passed
@nibanks nibanks deleted the nibanks/affinitize-execution-config branch November 6, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants