Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Clean up YieldProcessorNormalized #14739

Merged
merged 3 commits into from
Oct 31, 2017
Merged

Clean up YieldProcessorNormalized #14739

merged 3 commits into from
Oct 31, 2017

Conversation

kouvel
Copy link
Member

@kouvel kouvel commented Oct 28, 2017

Separated YieldProcessorNormalized changes from PR #14216 to simplify that PR:

  • Moved YieldProcessorNormalized into separate files
  • Cleaned up YieldProcessorNormalized

@kouvel kouvel added this to the 2.1.0 milestone Oct 28, 2017
@kouvel kouvel self-assigned this Oct 28, 2017

// Defaults are for when InitializeYieldProcessorNormalized has not yet been called or when no measurement is done, and are
// tuned for Skylake processors
unsigned int g_yieldsPerNormalizedYield = 1; // current value is for Skylake processors, this would be 9 for pre-Skylake
Copy link
Member

Choose a reason for hiding this comment

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

Nit: "this would be 9" => this is expected to be ~9"

const int NsPerSecond = 1000 * 1000 * 1000;

// If this constant is changed, the shift value in YieldProcessorWithBackOffNormalized() should be changed as well
const int MaxOptimalMaxNormalizedYieldsPerSpinIteration = 10;
Copy link
Member

Choose a reason for hiding this comment

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

Where did the value of 10 come from?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to calculate the value based on other constants instead of hard-coding something close to it and added some comments.

@kouvel kouvel merged commit 0bbce0c into dotnet:master Oct 31, 2017
@kouvel kouvel deleted the YpnFix branch October 31, 2017 19:04
briansull pushed a commit to briansull/coreclr that referenced this pull request Oct 31, 2017
Move YieldProcessorNormalized into separate files

Clean up YieldProcessorNormalized
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.

3 participants