Atomic Spinlock

From RTwiki
(Difference between revisions)
Jump to: navigation, search
 
(9 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
The new 2.6.31-rc4-rt1 patch annotates spinlocks which can not be converted to sleeping "spinlocks" as atomic_spinlock_t. The name is not perfect and we are looking for a better one which avoids the atomic confusion and expresses the fact that this lock always spins and disables preemption as well.
 
The new 2.6.31-rc4-rt1 patch annotates spinlocks which can not be converted to sleeping "spinlocks" as atomic_spinlock_t. The name is not perfect and we are looking for a better one which avoids the atomic confusion and expresses the fact that this lock always spins and disables preemption as well.
  
Please add your suggestions to the list below.
+
The problem is solved. See below.
  
 
{| class="wikitable"  
 
{| class="wikitable"  
Line 79: Line 79:
 
|-
 
|-
 
| radioactive_spinlock || to discourage it's use : )
 
| radioactive_spinlock || to discourage it's use : )
 +
|-
 +
| wake_lock || A lock that prevents sleep, term used for something similar on Android.
 +
|-
 +
| core_spinlock || (Added on behalf of Doug Niehaus who came up with that name)
 +
|-
 +
| nopreempt_spinlock ||
 +
|-
 +
| spin_spinlock ||
 +
|-
 +
| skid_lock || :-)
 +
|-
 +
| dread_lock ||  (Added on behalf of Peter Zijlstra and Jonathan Corbet from the RT mini-summit)
 +
|-
 +
| fred_lock || (from Thomas himself)
 +
|-
 +
| goldie_lock
 +
|-
 +
|kernel_lock || (Sven)
 +
|-
 +
| firm_spinlock ||
 +
|-
 +
| tireless_spinlock ||
 +
|-
 +
| actual_spinlock ||
 +
|-
 +
| definite_spinlock ||
 +
|-
 
|}
 
|}
  
 
If we pick one of the suggested names based on its accuracy and obviousness the inventor can expect free beer at a FOSS conference where ([[User:tglx | tglx]]) happens to be there as well.
 
If we pick one of the suggested names based on its accuracy and obviousness the inventor can expect free beer at a FOSS conference where ([[User:tglx | tglx]]) happens to be there as well.
 +
 +
Sorry, no winner from the list. The free beer goes to Linus, who came up with the best solution of all. See the commit [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=445c89514be242b1b0080056d50bdc1b72adeb5c] in Linus tree.

Latest revision as of 11:45, 11 March 2010

The new 2.6.31-rc4-rt1 patch annotates spinlocks which can not be converted to sleeping "spinlocks" as atomic_spinlock_t. The name is not perfect and we are looking for a better one which avoids the atomic confusion and expresses the fact that this lock always spins and disables preemption as well.

The problem is solved. See below.

name rationale
atomic_spinlock the current name, confusing vs. the atomic* APIs
real_spinlock self explaining, but sucks
hard_spinlock close, but sucks more
preemption_disabling_never_sleeping_spinlock way tooo long
vanilla_spinlock self explaining...but don't know if it is any better. :)
pure_spinlock sucks more than hard_spinlock?
indivisible_spinlock sucks more than hard_spinlock?
nonrt_spinlock inimicle to RT, better than evil_spinlock?
ondine_spinlock not self explaining, a bit of mythology?
spinning_lock same concept, easy identification
nuclear_spinlock more indivisible than atomic
quark_spinlock another two divisions smaller than the nucleus
insomniac_spinlock No geek slang
sleepless_spinlock
greedy_spinlock
big_spinlock
inconsiderate_spinlock don't use it
busy_spinlock
caffeinated_spinlock too many espressos
topspinlock tennis anyone?
slow_spinlock because it slows other things down
busywait_spinlock This name accurately describes its behavior and discourages people from using it (without deep thought).
rude_spinlock
busywait_lock Has same connotations as busywait_spinlock, but is more terse. Instead of trying to augment the 'spinlock' nomenclature, just abandon the 'spin' part of it and call it something else that describes what it does.
snooze_lock Short, Simple, descriptive. Alternatively, snooze_spinlock, but that sounds goofy.
hamster_wheel_lock Makes a hamster stay awake waiting for more food. Makes a thread stay awake waiting for more work.
livelock_t It never rests, and is probably best left to experts (like touching a live wire)
thor_spinlock If you use it you will get hit by Thor's Hammer :)
native_spinlock
cpu_spinlock Uses CPU 100% - Cannot be put to sleep
retarding_spinlock Can retard other processes...
pure_spinlock
spider_lock
busy_lock
active_spinlock as opposed to sleeping_spinlock
hyperactive_spinlock
radioactive_spinlock to discourage it's use : )
wake_lock A lock that prevents sleep, term used for something similar on Android.
core_spinlock (Added on behalf of Doug Niehaus who came up with that name)
nopreempt_spinlock
spin_spinlock
skid_lock  :-)
dread_lock (Added on behalf of Peter Zijlstra and Jonathan Corbet from the RT mini-summit)
fred_lock (from Thomas himself)
goldie_lock
kernel_lock (Sven)
firm_spinlock
tireless_spinlock
actual_spinlock
definite_spinlock

If we pick one of the suggested names based on its accuracy and obviousness the inventor can expect free beer at a FOSS conference where ( tglx) happens to be there as well.

Sorry, no winner from the list. The free beer goes to Linus, who came up with the best solution of all. See the commit [1] in Linus tree.

Personal tools