Loongson CPU原子更新丢失问题
问题概述
在Loongson CPU上出现原子更新丢失的 bug,导致多线程场景下数据不一致。官方手册未描述的内部寄存器MCSR24的第13位需要被设置为1才能修复,且该修复对性能影响极小。
痛点标签
- 原子更新丢失导致多线程数据不一致
- 内部CSR MCSR24未在手册中说明,增加调试难度
- 虽然性能影响小,但仍是真实缺陷
待验证问题
- 该缺陷是否主要影响多线程应用的原子操作?
- 设置MCSR24位13的方法能在所有Loongson CPU型号上统一适用吗?
- 应用该修复后是否会出现其他兼容性问题?
证据
原话
The fix is to set bit 13 of MCSR24 to 1. MCSR24 is an internal CSR whose function is not described in the manual. After setting this bit, the lost update no longer occurs. Testing showed the performance loss is very small: single-core performance is unaffected, and multi-core performance drops only slightly. Presumably this is a so-called “chicken bit”.
免责声明:本卡片由 AI 从社区讨论中提炼,属于「痛点证据」,是需求分析与验证的起点,不等同于「已验证的市场需求」。AI 存在分析局限,关键决策前请打开上方原始讨论人工复核。