Skip to contentSkip to conversation

Documentation: improvement to volatile considered harmful

PATCH New Heikki Orsila 1 participant 1 message Jun 26, 2007 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: improvement to volatile considered harmful

Kernel locking/synchronization primitives are better than volatile types from code readability point of view also.

This patch is against 2.6.22-rc6.

Documentation/volatile-considered-harmful.txt +3 -2
index 10c2e41..ab9e62e 100644
@@ -17,8 +17,9 @@ all optimization-related problems in a more efficient way.
 
 Like volatile, the kernel primitives which make concurrent access to data
 safe (spinlocks, mutexes, memory barriers, etc.) are designed to prevent
-unwanted optimization.  If they are being used properly, there will be no
-need to use volatile as well.  If volatile is still necessary, there is
+unwanted optimization. If they are being used properly, there will be no
+need to use volatile as well. Also, they make code more readable as they
+represent their intent explicitly. If volatile is still necessary, there is
 almost certainly a bug in the code somewhere.  In properly-written kernel
 code, volatile can only serve to slow things down.