Skip to content

Conversation

zhengyu123
Copy link
Contributor

@zhengyu123 zhengyu123 commented Aug 13, 2025

What does this PR do?:
Pad SpinLock to avoid false sharing.

Motivation:
Without proper padding, Profiler::_locks, an array of SpinLock, is likely suffering from cache line false sharing.

Additional Notes:

How to test the change?:

  • Regular tests do not fail
  • Benchmarks does not regress

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.
  • JIRA: PROF-12321

Unsure? Have a question? Request a review!

@dd-octo-sts
Copy link

dd-octo-sts bot commented Aug 13, 2025

CppCheck Report

Errors (2)

Warnings (9)

Style Violations (301)

Copy link
Collaborator

@jbachorik jbachorik left a comment

Choose a reason for hiding this comment

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

Good catch!

I think this would be a good candidate for upstreaming.

@dd-octo-sts
Copy link

dd-octo-sts bot commented Aug 13, 2025

CppCheck Report

Errors (2)

Warnings (8)

Style Violations (299)

@zhengyu123 zhengyu123 marked this pull request as ready for review August 13, 2025 15:30
@zhengyu123 zhengyu123 merged commit 1abf1eb into main Aug 13, 2025
95 checks passed
@zhengyu123 zhengyu123 deleted the zgu/padding_spinlock branch August 13, 2025 15:30
@github-actions github-actions bot added this to the 1.30.0 milestone Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants