No more 24-bit atomic_t
As of 2.6.3, this limitation no longer holds. This patch by Keith M Wesolowski has changed the Sparc32 implementation to a version (taken from the PA-RISC architecture) which provides full 32-bit atomic variables.
The new implementation works by creating a small array (four entries) of
spinlocks. When an operation is to be performed on an atomic variable, one
of those spinlocks is chosen by a hash function; the code holds the given
lock while manipulating the variable. The result is proper locking for
atomic operations without doubling the size of every atomic_t in
the system. The patch was quickly picked up and merged, and kernel
programmers have one less strange limitation to worry about.
Index entries for this article | |
---|---|
Kernel | atomic_t |
Posted Feb 19, 2004 21:32 UTC (Thu)
by xorbe (guest, #3165)
[Link] (2 responses)
Posted Feb 20, 2004 20:39 UTC (Fri)
by ptr (guest, #5885)
[Link] (1 responses)
Posted Feb 21, 2004 4:09 UTC (Sat)
by jzbiciak (guest, #5246)
[Link]
"a small array (four entries) of spinlocks"No more 24-bit atomic_t
4 spinlocks for the entire system's atomic variables?
Helloooooooooo deadlock!
Well, without digging deep, there should not be any (additional) dead locks, since always only up to one of the four locks is used per thread... Additionally, the atomicity dead lock is always the last. If the locking order was robust before, it will be after the change.
No more 24-bit atomic_t
Spinlocks disable preemption, right?
No more 24-bit atomic_t