-
Notifications
You must be signed in to change notification settings - Fork 1
Description
--- As of 2026-02-11T15:29:00.000Z ---
Heikki Linnakangas proposed moving the ProcStructLock spinlock from its own shared memory area into the ProcGlobal struct for better cache locality, arguing that the separate allocation was for historical reasons. Chao Li reviewed the patch and identified a missing SpinLockInit call for the relocated spinlock. Ashutosh Bapat confirmed this was needed and noted the change aligns with other shared structures that embed spinlocks. Tom Lane explained the bug went unnoticed because modern platforms initialize spinlocks to zero and shared memory starts as zeros, but warned this creates a testing gap since older detection methods are gone. Heikki fixed the initialization issue and pushed the change. The discussion then shifted to whether accepting all-zeros as valid spinlock initialization is safe, with Tom expressing concerns about platform assumptions.
Heikki Linnakangas提议将ProcStructLock自旋锁从独立的共享内存区域移动到ProcGlobal结构体中以获得更好的缓存局部性,认为独立分配是出于历史原因。Chao Li审查了补丁并发现重定位的自旋锁缺少SpinLockInit调用。Ashutosh Bapat确认这是必需的,并指出该更改与其他嵌入自旋锁的共享结构保持一致。Tom Lane解释说这个bug被忽略是因为现代平台将自旋锁初始化为零而共享内存以零开始,但警告这会造成测试空白,因为旧的检测方法已经消失。Heikki修复了初始化问题并推送了更改。讨论随后转向接受全零作为有效自旋锁初始化是否安全,Tom对平台假设表示担忧。
participants - 参与者: