Re: [patch] spinlocks: remove 'volatile'

Linus Torvalds
2006-07-08T05:25:32Z

On Fri, 7 Jul 2006, Albert Cahalan wrote:
>
> Key thing being "language environment", meaning gcc.

No.

The key thing is "language environment", meaning THE HARDWARE.

> By the language spec, volatile is a low-performance way to
> get the job done.

No.

"volatile" simply CANNOT get the job done. It fundamentally does _nothing_
for all the issues that are fundamental today: CPU memory ordering in SMP,
special IO synchronization requirements for memory-mapped IO registers etc
etc.

It's not that "volatile" is the "portable way". It's that "volatile" is
fundamentally not sufficient for the job.

Linus