Spinlock irqsave usage checks
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 15 Nov 2012 19:46:32 +0000 (11:46 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 21 Nov 2012 23:41:18 +0000 (15:41 -0800)
commit19a0b6f97aa783c1678ac87a6225d6b23b4a03c5
treec6fcefa4a94395861006e0b13e52586f6a533bdd
parent44cc3cf89b2cb8b28e7563e088d3d87d39f7de66
Spinlock irqsave usage checks

Controlled with CONFIG_SPINLOCK_DEBUG.  One big issue is that we usually
need locks to tell ourselves about the deadlock - print locks, kmsgs
locks, etc.  We'll need something else to deal with this.

Here's a list of all irqsave locks.  A few of them weren't even
initialized.  Others probably don't need to be irqsave.  And a few are
from some really ancient code.  Some of these were only detected at
runtime by the usage checks.

Take a look at these and any of your other locks, and fix them up
accordingly.

 /* sync stuff */
 barrier->lock
 list->lock (checklists)

 /* page allocation / coloring */
 cache_colors_lock
 colored_page_free_list_lock (arch dependent btw)

 /* slab allocator */
 cp->cache_lock
 kmem_caches_lock

 /* riscv/sparc */
 fesvr_lock
 cas_lock (needs attention, might not compile)

 /* console printing and reading */
 lock (x86 console lock, cons_putc needs renamed)
 output_lock (serializes all printks)
 print_info_lock (testing.c)
 ptf_lock (x86 trapframe printing lock)
 readline_lock

 /* kmsg */
 per_cpu_info[i].immed_amsg_lock
 per_cpu_info[i].routine_amsg_lock

 /* misc */
 arsc_proc_lock
 systrace_lock (does this need irqsave?)
 ucq hash locks
 packet_buffers_lock
20 files changed:
kern/arch/i686/console.c
kern/arch/i686/nic_common.c
kern/arch/i686/page_alloc.c
kern/arch/i686/trap.c
kern/arch/riscv/atomic.c
kern/arch/riscv/console.c
kern/arch/riscv/page_alloc.c
kern/arch/sparc/atomic.h
kern/arch/sparc/page_alloc.c
kern/include/atomic.h
kern/src/arsc.c
kern/src/atomic.c
kern/src/colored_caches.c
kern/src/printf.c
kern/src/process.c
kern/src/readline.c
kern/src/slab.c
kern/src/smp.c
kern/src/syscall.c
kern/src/testing.c