Added atomic and per-cpu.
[cascardo/kernel/slides/.git] / 07concurrency / concurrency
index afbd041..43815d6 100644 (file)
@@ -97,4 +97,36 @@ the critical section at a time.
 * They create an atomic context themselves, so *do not* sleep while
   using them
 
+# Atomic
+
+* atomic\\_t
+* ATOMIC\\_INIT(val)
+* atomic\\_read(v)
+* atomic\\_set(v, i)
+* atomic\\_add\\_return(i, &v)
+* atomic\\_add(i, &v)
+* atomic\\_inc(i, &v)
+* atomic\\_sub
+* atomic\\_dec
+* atomic\\_dec\\_and\\_test
+
+# Bitmap
+
+May be used for locking, but spinlocks are better nowadays.
+
+# Per-CPU
+
+* linux/percpu.h
+* DEFINE\\_PER\\_CPU(type, name)
+* get\\_cpu\\_var(name)
+* put\\_cpu\\_var(name)
+* per\\_cpu(name, cpu)
+* alloc\\_percpu(type)
+* free\\_percpu
+* cpu = get\\_cpu()
+* per\\_cpu\\_ptr(var, cpu)
+* put\\_cpu()
+
+# RCU
+