Re: [patch] spinlocks: remove 'volatile'

From: Linus Torvalds
Date: Sat Jul 08 2006 - 01:26:41 EST




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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/