cpython/Include/internal
Sam Gross 6ea4f842fb
[3.14] gh-144438: Fix false sharing between QSBR and tlbc_index (gh-144554) (#144923)
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 6577d870b0)
2026-03-31 19:20:24 +00:00
..
mimalloc [3.14] Doc: fix duplicated words (GH-136086) (#136108) 2025-06-29 18:45:26 -04:00
pycore_abstract.h gh-106320: Remove private AC converter functions (#108505) 2023-08-26 04:05:17 +02:00
pycore_asdl.h gh-87347: Add parenthesis around macro arguments (#93915) 2022-06-20 16:04:52 +02:00
pycore_ast.h gh-132661: Implement PEP 750 (#132662) 2025-04-30 11:46:41 +02:00
pycore_ast_state.h gh-132661: Implement PEP 750 (#132662) 2025-04-30 11:46:41 +02:00
pycore_atexit.h gh-131238: Remove pycore_lock.h includes (#131483) 2025-03-19 23:46:25 +00:00
pycore_audit.h gh-125604: Move _Py_AuditHookEntry, etc. Out of pycore_runtime.h (gh-125605) 2024-10-18 09:26:08 -06:00
pycore_backoff.h gh-131238: Move pycore_obmalloc.h include to pycore_runtime_structs.h (#131482) 2025-03-19 23:32:30 +00:00
pycore_bitutils.h gh-108216: Cleanup #include in internal header files (#108228) 2023-08-21 18:05:59 +00:00
pycore_blocks_output_buffer.h gh-108220: Internal header files require Py_BUILD_CORE to be defined (#108221) 2023-08-21 19:15:52 +02:00
pycore_brc.h gh-131238: Remove pycore_lock.h includes (#131483) 2025-03-19 23:46:25 +00:00
pycore_bytes_methods.h gh-117431: Adapt bytes and bytearray .find() and friends to Argument Clinic (#117502) 2024-04-12 07:40:55 +00:00
pycore_bytesobject.h [3.14] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133942) 2025-05-13 16:25:08 +03:00
pycore_c_array.h gh-130080: move _Py_EnsureArrayLargeEnough to a separate header so it can be used outside of the compiler (#130930) 2025-03-13 16:02:58 +00:00
pycore_call.h [3.14] gh-145779: Improve classmethod/staticmethod scaling in free-threaded build (gh-145826) (#146088) 2026-03-19 10:49:12 -04:00
pycore_capsule.h gh-108240: Add pycore_capsule.h internal header file (#108596) 2023-08-29 01:20:02 +00:00
pycore_cell.h [3.14] gh-144490: Fix C++ compatibility in pycore_cell.h (GH-144482) (GH-144555) 2026-02-07 03:37:41 +00:00
pycore_ceval.h [3.14] gh-145779: Improve classmethod/staticmethod scaling in free-threaded build (gh-145826) (#146088) 2026-03-19 10:49:12 -04:00
pycore_ceval_state.h gh-131238: Remove pycore_lock.h includes (#131483) 2025-03-19 23:46:25 +00:00
pycore_code.h [3.14] gh-140815: Fix faulthandler for invalid/freed frame (GH-140921) (#140981) 2025-11-04 11:18:23 +00:00
pycore_codecs.h gh-131238: Remove pycore_lock.h includes (#131483) 2025-03-19 23:46:25 +00:00
pycore_compile.h [3.14] gh-131927: Do not emit PEP 765 warnings in ast.parse() (GH-139642) (GH-140786) 2025-10-30 11:25:34 +00:00
pycore_complexobject.h gh-128813: hide mixed-mode functions for complex arithmetic from C-API (#131703) 2025-04-22 14:18:18 +02:00
pycore_condvar.h gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (#131044) 2025-03-11 12:33:01 +01:00
pycore_context.h GH-131238: Core header refactor (GH-131250) 2025-03-17 09:19:04 +00:00
pycore_critical_section.h [3.14] gh-133296: Publicly expose critical section API that accepts PyMutex (gh-135899) (#136969) 2025-07-22 12:44:59 +03:00
pycore_crossinterp.h [3.14] gh-132775: Clean Up Cross-Interpreter Error Handling (gh-135492) 2025-06-14 02:08:25 +00:00
pycore_crossinterp_data_registry.h [3.14] gh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-134418) 2025-05-21 14:47:56 +00:00
pycore_debug_offsets.h [3.14] gh-135755: Make Py_MAX_SCRIPT_PATH_SIZE private (GH-138350) (#138356) 2025-09-16 15:49:35 +03:00
pycore_descrobject.h gh-106320: Move _PyMethodWrapper_Type to internal C API (#107064) 2023-07-22 20:57:59 +00:00
pycore_dict.h [3.14] gh-134043: use stackrefs for dict lookup in _PyObject_GetMethodStackRef (GH-136412) (#146077) 2026-03-17 16:59:26 -04:00
pycore_dict_state.h gh-124296: Remove private dictionary version tag (PEP 699) (#124472) 2024-10-01 12:39:56 -04:00
pycore_dtoa.h GH-131238: Core header refactor (GH-131250) 2025-03-17 09:19:04 +00:00
pycore_emscripten_signal.h GH-108614: Unbreak emscripten build (GH-109132) 2023-09-08 17:54:45 +01:00
pycore_emscripten_trampoline.h [3.14] gh-145037: Fix Emscripten trampoline with emcc >= 4.0.19 (GH-145038) (#145283) 2026-02-27 08:55:59 +08:00
pycore_exceptions.h gh-129668: Fix thread-safety of MemoryError freelist in free threaded build (gh-129704) 2025-02-06 12:38:12 -05:00
pycore_faulthandler.h gh-127604: Add C stack dumps to faulthandler (#128159) 2025-04-21 20:48:02 +01:00
pycore_fileutils.h gh-131238: Use pycore_interp_structs.h header (#131481) 2025-03-19 23:13:25 +00:00
pycore_fileutils_windows.h gh-108220: Internal header files require Py_BUILD_CORE to be defined (#108221) 2023-08-21 19:15:52 +02:00
pycore_floatobject.h GH-131238: Core header refactor (GH-131250) 2025-03-17 09:19:04 +00:00
pycore_flowgraph.h gh-119744: move a few functions from compile.c to flowgraph.c (#119745) 2024-05-30 21:55:06 +01:00
pycore_format.h gh-104018: remove unused format "z" handling in string formatfloat() (#104107) 2023-05-07 10:11:42 +05:30
pycore_frame.h gh-130704: Strength reduce LOAD_FAST{_LOAD_FAST} (#130708) 2025-04-01 10:18:42 -07:00
pycore_freelist.h gh-131238: Remove includes from pycore_interp.h (#131495) 2025-03-20 11:35:23 +00:00
pycore_freelist_state.h gh-126703: Add freelist for range and range_iter objects (GH-128619) 2025-04-07 04:40:52 +08:00
pycore_function.h [3.14] gh-145779: Improve classmethod/staticmethod scaling in free-threaded build (gh-145826) (#146088) 2026-03-19 10:49:12 -04:00
pycore_gc.h [3.14] GH-139951: Fix major GC performance regression. Backport of GH-140262 (GH-140447) 2025-10-23 15:26:58 +01:00
pycore_genobject.h gh-131238: Move _Py_VISIT_STACKREF() to pycore_stackref.h (#131560) 2025-03-21 23:24:14 +01:00
pycore_getopt.h
pycore_gil.h gh-116322: Enable the GIL while loading C extension modules (#118560) 2024-05-06 23:07:23 -04:00
pycore_global_objects.h GH-131238: Core header refactor (GH-131250) 2025-03-17 09:19:04 +00:00
pycore_global_objects_fini_generated.h [3.14] gh-91048: Fix external inspection multi-threaded performance (GH-136005) (#136080) 2025-06-28 19:12:54 +01:00
pycore_global_strings.h [3.14] gh-91048: Fix external inspection multi-threaded performance (GH-136005) (#136080) 2025-06-28 19:12:54 +01:00
pycore_hamt.h GH-131238: Core header refactor (GH-131250) 2025-03-17 09:19:04 +00:00
pycore_hashtable.h gh-107211: No longer export internal functions (5) (#108423) 2023-08-24 16:06:53 +00:00
pycore_import.h gh-132775: Drop PyUnstable_InterpreterState_GetMainModule() (gh-132978) 2025-04-28 12:46:22 -06:00
pycore_importdl.h gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952) 2024-08-13 14:44:57 -06:00
pycore_index_pool.h GH-131238: Core header refactor (GH-131250) 2025-03-17 09:19:04 +00:00
pycore_initconfig.h [3.14] gh-116749: Fix code comment for _PyConfig_GIL_DEFAULT (gh-141804) (gh-141911) 2025-11-24 16:10:59 +00:00
pycore_instruction_sequence.h gh-130907: Treat all module-level annotations as conditional (#131550) 2025-04-28 06:10:28 -07:00
pycore_instruments.h gh-130931: Add pycore_typedefs.h internal header (#131396) 2025-03-19 15:23:32 +01:00
pycore_interp.h gh-131238: Remove includes from pycore_interp.h (#131495) 2025-03-20 11:35:23 +00:00
pycore_interp_structs.h [3.14] gh-143228: Fix UAF in perf trampoline during finalization (GH-143233) (#143247) 2025-12-28 14:32:11 +00:00
pycore_interpframe.h [3.14] gh-140815: Fix faulthandler for invalid/freed frame (GH-140921) (#140981) 2025-11-04 11:18:23 +00:00
pycore_interpframe_structs.h gh-131238: Add pycore_interpframe_structs.h header (#131553) 2025-03-21 17:19:47 +00:00
pycore_interpolation.h gh-132661: Implement PEP 750 (#132662) 2025-04-30 11:46:41 +02:00
pycore_intrinsics.h gh-116126: Implement PEP 696 (#116129) 2024-05-03 06:17:32 -07:00
pycore_jit.h GH-131498: Remove conditional stack effects (GH-131499) 2025-03-20 15:39:38 +00:00
pycore_list.h gh-100239: specialize BINARY_OP/SUBSCR for list-slice (#132626) 2025-05-01 10:28:52 +00:00
pycore_llist.h gh-111964: Implement stop-the-world pauses (gh-112471) 2024-01-23 11:08:23 -07:00
pycore_lock.h [3.14] gh-134009: Expose PyMutex_IsLocked in the public C API (gh-134365) (#136971) 2025-07-22 12:48:08 +03:00
pycore_long.h [3.14] gh-143050: Correct PyLong_FromString() to use _PyLong_Negate() (GH-145901) (#147331) 2026-03-31 16:14:12 +02:00
pycore_magic_number.h [3.14] gh-138349: Fix crash when combining module-level annotation and listcomp (#138363) (#138749) 2025-09-11 08:43:57 +03:00
pycore_memoryobject.h gh-132776: Revert Moving memoryview XIData Code to memoryobject.c (gh-132960) 2025-04-25 16:43:50 +00:00
pycore_mimalloc.h gh-122584: Import mimalloc headers in a C++ context (#122587) 2024-08-15 09:01:01 -04:00
pycore_modsupport.h gh-112136: Remove unused #include "pycore_lock.h" (#127093) 2024-11-21 13:50:11 +01:00
pycore_moduleobject.h gh-132775: Add _PyModule_GetFilenameObject() and _PyModule_GetFilenameUTF8() (gh-132979) 2025-04-28 12:41:32 -06:00
pycore_namespace.h gh-107211: No longer export internal functions (4) (#107217) 2023-07-25 03:16:28 +00:00
pycore_object.h [3.14] gh-145779: Improve classmethod/staticmethod scaling in free-threaded build (gh-145826) (#146088) 2026-03-19 10:49:12 -04:00
pycore_object_alloc.h gh-112529: Use GC heaps for GC allocations in free-threaded builds (gh-114157) 2024-01-21 01:14:45 +09:00
pycore_object_deferred.h gh-117139: Convert the evaluation stack to stack refs (#118450) 2024-06-27 03:10:43 +08:00
pycore_object_stack.h gh-125859: Fix crash when gc.get_objects is called during GC (#125882) 2024-10-24 09:33:11 -04:00
pycore_object_state.h gh-125604: Move _Py_AuditHookEntry, etc. Out of pycore_runtime.h (gh-125605) 2024-10-18 09:26:08 -06:00
pycore_obmalloc.h gh-92953: Improve nextpool/prevpool comment. (gh-125545) 2024-10-15 11:47:20 -07:00
pycore_obmalloc_init.h gh-113055: Use pointer for interp->obmalloc state (gh-113412) 2024-01-26 19:38:14 -08:00
pycore_opcode_metadata.h [3.14] gh-144012: Check null binary op extend (GH-144014) (GH-144038) 2026-01-20 18:05:56 +00:00
pycore_opcode_utils.h [3.14] gh-132775: Unrevert "Add _PyCode_VerifyStateless()" (gh-133625) 2025-05-08 00:00:33 +00:00
pycore_optimizer.h GH-133231: Changes to executor management to support proposed sys._jit module (GH-133287) 2025-05-04 10:05:35 +01:00
pycore_parking_lot.h gh-110850: Cleanup pycore_time.h includes (#115724) 2024-02-20 16:50:43 +00:00
pycore_parser.h GH-131238: Core header refactor (GH-131250) 2025-03-17 09:19:04 +00:00
pycore_pathconfig.h gh-107211: No longer export internal functions (6) (#108424) 2023-08-24 17:28:35 +02:00
pycore_pyarena.h gh-107211: Fix test_peg_generator (#108435) 2023-08-24 17:47:44 +00:00
pycore_pyatomic_ft_wrappers.h [3.14] gh-145685: Improve scaling of type attribute lookups (gh-145774) (#145874) 2026-03-12 14:33:05 -04:00
pycore_pybuffer.h gh-76785: Rename _xxsubinterpreters to _interpreters (gh-117791) 2024-04-24 16:18:24 +00:00
pycore_pyerrors.h [3.14] gh-132775: Use _PyFunction_VerifyStateless() and _PyCode_VerifyStateless() (gh-134465) 2025-05-21 20:43:29 +00:00
pycore_pyhash.h GH-131238: Core header refactor (GH-131250) 2025-03-17 09:19:04 +00:00
pycore_pylifecycle.h [3.14] gh-136421: Load _datetime static types during interpreter initialization (GH-136583) (GH-136943) 2025-07-21 19:23:05 -04:00
pycore_pymath.h [3.14] gh-142342: Fix m68k assembler operand constraints for %fpcr access (gh-142343) (#142458) 2025-12-09 14:13:31 +00:00
pycore_pymem.h [3.14] gh-116008: Detect freed thread state in faulthandler (GH-141988) (#142013) 2025-11-27 20:34:00 +00:00
pycore_pymem_init.h gh-115103: Implement delayed free mechanism for free-threaded builds (#115367) 2024-02-20 13:04:37 -05:00
pycore_pystate.h [3.14] GH-139914: Handle stack growth direction on HPPA (GH-140028) (#141404) 2025-11-23 15:55:33 -08:00
pycore_pystats.h gh-108753: Enhance pystats (#108754) 2023-09-06 15:54:59 +00:00
pycore_pythonrun.h [3.14] gh-140222: Increase stack margin on debug build (GH-142452) (#142471) 2025-12-09 15:59:42 +00:00
pycore_pythread.h GH-131238: Core header refactor (GH-131250) 2025-03-17 09:19:04 +00:00
pycore_qsbr.h [3.14] gh-144438: Fix false sharing between QSBR and tlbc_index (gh-144554) (#144923) 2026-03-31 19:20:24 +00:00
pycore_range.h gh-89189: More compact range iterator (GH-27986) 2022-11-30 23:04:30 +02:00
pycore_runtime.h gh-131238: Use pycore_interp_structs.h header (#131481) 2025-03-19 23:13:25 +00:00
pycore_runtime_init.h Remove duplicate includes: Include/internal/ (#132624) 2025-05-06 02:08:42 +01:00
pycore_runtime_init_generated.h [3.14] gh-91048: Fix external inspection multi-threaded performance (GH-136005) (#136080) 2025-06-28 19:12:54 +01:00
pycore_runtime_structs.h [3.14] gh-145037: Fix Emscripten trampoline with emcc >= 4.0.19 (GH-145038) (#145283) 2026-02-27 08:55:59 +08:00
pycore_semaphore.h gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (#131044) 2025-03-11 12:33:01 +01:00
pycore_setobject.h gh-130312: SET_ADD should not lock (#130136) 2025-03-21 15:58:32 -07:00
pycore_signal.h gh-109693: Use pyatomic.h for signal module (gh-110480) 2023-10-10 08:26:29 +09:00
pycore_sliceobject.h GH-115802: JIT "small" code for Windows (GH-115964) 2024-02-29 08:11:28 -08:00
pycore_stackref.h [3.14] gh-145779: Improve classmethod/staticmethod scaling in free-threaded build (gh-145826) (#146088) 2026-03-19 10:49:12 -04:00
pycore_stats.h [3.14] gh-138264: Fix gcc 14 compiler warnings (GH-138265) (GH-138426) 2025-10-07 22:26:05 +02:00
pycore_strhex.h gh-107211: No longer export pycore_strhex.h functions (#108229) 2023-08-21 18:12:22 +00:00
pycore_structs.h GH-131498: Cases generator: manage stacks automatically (GH-132074) 2025-04-04 17:59:36 +01:00
pycore_structseq.h gh-107211: No longer export internal functions (4) (#107217) 2023-07-25 03:16:28 +00:00
pycore_symtable.h gh-130924: Do not create cells for usages of names in local annotations (#131843) 2025-03-29 21:15:48 +00:00
pycore_sysmodule.h gh-131591: Implement PEP 768 (#131937) 2025-04-03 16:20:01 +01:00
pycore_template.h gh-132661: Implement PEP 750 (#132662) 2025-04-30 11:46:41 +02:00
pycore_time.h gh-131238: Use pycore_interp_structs.h header (#131481) 2025-03-19 23:13:25 +00:00
pycore_token.h gh-132661: Implement PEP 750 (#132662) 2025-04-30 11:46:41 +02:00
pycore_traceback.h [3.14] gh-125434: Display thread name in faulthandler on Windows (#142011) 2025-11-27 12:05:37 +00:00
pycore_tracemalloc.h [3.14] gh-143057: avoid locking in tracemalloc C-APIs when it is not enabled (GH-143065) (#143071) 2025-12-22 16:04:24 +00:00
pycore_tstate.h [3.14] gh-144438: Fix false sharing between QSBR and tlbc_index (gh-144554) (#144923) 2026-03-31 19:20:24 +00:00
pycore_tuple.h gh-131525: Cache the result of tuple_hash (#131529) 2025-03-27 09:57:06 -04:00
pycore_typedefs.h gh-130931: Add pycore_typedefs.h internal header (#131396) 2025-03-19 15:23:32 +01:00
pycore_typeobject.h [3.14] gh-123241: Don't modify ref count during visitation (GH-142232) (#142567) 2025-12-11 10:51:11 -08:00
pycore_typevarobject.h gh-119180: Add evaluate functions for type params and type aliases (#122212) 2024-07-27 17:24:10 +00:00
pycore_ucnhash.h gh-111972: Make Unicode name C APIcapsule initialization thread-safe (#112249) 2023-11-30 11:12:49 +01:00
pycore_unicodeobject.h [3.14] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133942) 2025-05-13 16:25:08 +03:00
pycore_unicodeobject_generated.h [3.14] gh-91048: Fix external inspection multi-threaded performance (GH-136005) (#136080) 2025-06-28 19:12:54 +01:00
pycore_unionobject.h gh-105499: Merge typing.Union and types.UnionType (#105511) 2025-03-04 11:44:19 -08:00
pycore_uniqueid.h GH-131238: Core header refactor (GH-131250) 2025-03-17 09:19:04 +00:00
pycore_uop_ids.h GH-131798: Split CALL_LEN into several uops (GH-133180) 2025-05-05 14:31:48 -07:00
pycore_uop_metadata.h [3.14] gh-144012: Check null binary op extend (GH-144014) (GH-144038) 2026-01-20 18:05:56 +00:00
pycore_warnings.h GH-131238: Core header refactor (GH-131250) 2025-03-17 09:19:04 +00:00
pycore_weakref.h [3.14] gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (#136119) 2025-06-30 15:59:22 +02:00