FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.14] gh-144438: Fix false sharing between QSBR and tlbc_index (gh-144554) by colesbury · Pull Request #144923 · python/cpython · GitHub

Repository navigation

[3.14] gh-144438: Fix false sharing between QSBR and tlbc_index (gh-144554) - #144923

Merged
colesbury merged 3 commits into
python:3.14from
colesbury:backport-6577d87-3.14
Mar 31, 2026
Merged

colesbury merged 3 commits into
python:3.14from
colesbury:backport-6577d87-3.14

Conversation

colesbury commented Feb 17, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Align the QSBR thread state array to a 64-byte cache line boundary and add padding at the end of _PyThreadStateImpl. Depending on heap layout, the QSBR array could end up sharing a cache line with a thread's tlbc_index, causing QSBR quiescent state updates to contend with reads of tlbc_index in RESUME_CHECK. This is sensitive to earlier allocations during interpreter init and can appear or disappear with seemingly unrelated changes.

Either change alone is sufficient to fix the specific issue, but both are worthwhile to avoid similar problems in the future. (cherry picked from commit 6577d87)

…pythongh-144554)

Align the QSBR thread state array to a 64-byte cache line boundary
and add padding at the end of _PyThreadStateImpl. Depending on heap
layout, the QSBR array could end up sharing a cache line with a
thread's tlbc_index, causing QSBR quiescent state updates to contend
with reads of tlbc_index in RESUME_CHECK. This is sensitive to
earlier allocations during interpreter init and can appear or
disappear with seemingly unrelated changes.

Either change alone is sufficient to fix the specific issue, but both
are worthwhile to avoid similar problems in the future.
(cherry picked from commit 6577d87)

Co-authored-by: Sam Gross <colesbury@gmail.com>
colesbury marked this pull request as ready for review February 17, 2026 18:06
colesbury requested a review from hugovk February 17, 2026 18:06

Copy link
Copy Markdown
Contributor Author

Added @hugovk for _PyRuntime size change due to field in struct _qsbr_shared

hugovk commented Mar 30, 2026

Copy link
Copy Markdown
Member

Okay to merge for 3.14, please resolve conflicts.

colesbury enabled auto-merge (squash) March 31, 2026 12:34
colesbury merged commit 6ea4f84 into python:3.14 Mar 31, 2026
86 of 88 checks passed
colesbury deleted the backport-6577d87-3.14 branch April 20, 2026 15:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL