Two Decades of Linux Expertise 400-9696-513 24/7 technical support

Linux kernel adds two-byte atomic emulation: legacy CPUs face removal, domestic C-SKY architecture draws attention

Linux kernel adds two-byte atomic emulation: legacy CPUs face removal, domestic C-SKY architecture draws attention

According to a MyDrivers report on October 22, the Linux kernel recently introduced emulation for the two-byte cmpxchg() operation: veteran developer Paul E. McKenney submitted a patch adding a cmpxchg_emu_u16() function that uses four-byte atomic operations to emulate the two-byte version, applying it to ports for CPU architectures such as SH, ARC, C-SKY and Xtensa so that generic kernel code can safely assume every architecture supports two-byte atomics.

This seemingly compatibility-friendly change came with a farewell notice to aging hardware — the last line of the pull request stirred wide discussion in the community: the mainline kernel may soon abandon systems that lack a native two-byte store instruction. The reason is that software emulation can solve the atomic-operation problem but cannot replace hardware-level direct store capability. That briefly put C-SKY, the domestic 32-bit RISC architecture that only joined the kernel mainline in 2018, in the spotlight, although McKenney subsequently clarified that the removal plan is not aimed at the entire C-SKY architecture but at specific, extremely old systems such as the Acorn RISC PC.

For enterprise IT and Xinchuang (China's IT-application-innovation push) practitioners, the episode offers two lessons: first, the kernel mainline accepts or drops architectures on the yardstick of modern instruction capability, so installed systems that depend on old CPUs should plan migration paths early — hardware that cannot even support basic two-byte instructions will be fully abandoned by modern kernels in time; second, for domestic architectures to keep their mainline status they must continually align with upstream evolution on fundamental instruction-set features such as atomics and memory consistency — beyond C-SKY, this is exactly the logic behind the push of newer domestic lines such as RISC-V into the server market. Selection and elimination in the kernel ecosystem never stop, and platform selection should treat an architecture's activity in the upstream kernel as a long-term evaluation dimension.

Source: MyDrivers

← Back to list Enquire about related services

Related reading

Call us Message
Home Services Consult Message