Lost Atomic Update on Loongson CPU
Problem
An atomic update loss bug occurs on Loongson CPUs, causing data inconsistency in multi-threaded contexts. The fix requires setting bit 13 of an undocumented internal CSR MCSR24 to 1, with only a slight performance impact.
Pain points
- Lost atomic updates causing multi-threaded data inconsistency
- Undocumented internal CSR MCSR24 complicates debugging
- Minor performance impact but represents a real defect
Questions to verify
- Does the defect primarily affect atomic operations in multi-threaded applications?
- Is setting bit 13 of MCSR24 applicable uniformly across all Loongson CPU models?
- After applying this fix, are there any other compatibility issues that may arise?
Evidence
quote
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”.
Disclaimer: this card is distilled by AI from community discussions as “pain point evidence”. It is a starting point for need analysis and validation, not a “validated market need”. AI has analytical limits; please open the original discussion above to manually verify before key decisions.