From c8790f5d0971d21e6e72f8770214911e4d4fe649 Mon Sep 17 00:00:00 2001 From: Attilio Rao Date: Thu, 20 Sep 2007 20:38:43 +0000 Subject: [PATCH] Fix some entries in the locks static table of witness. In particular: - smp_tlb_mtx is no longer used, so it is axed. - smp rendezvous lock isn't really a leaf spin-mutex. Its bad placement in the table, however, has been the source of a false positive LOR reporting with the dt_lock. However, smp rendezvous lock would have had sched_lock there for older lock, so it wasn't still a leaf lock. - allpmaps is only used in ia32 architecture, so it is inserted in the appropriate stub. Addictionally: - kse_zombie_lock is no longer present, so its definition is axed out. - zombie_lock doesn't need to have an exported symbol, so just let's it be declared as static. Tested by: kris Approved by: jeff (mentor) Approved by: re --- sys/amd64/include/smp.h | 1 - sys/i386/include/smp.h | 1 - sys/kern/kern_switch.c | 1 - sys/kern/kern_thread.c | 2 +- sys/kern/subr_witness.c | 17 ++++++++--------- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/sys/amd64/include/smp.h b/sys/amd64/include/smp.h index cafe4cd95fd8..d85c55e04fb7 100644 --- a/sys/amd64/include/smp.h +++ b/sys/amd64/include/smp.h @@ -34,7 +34,6 @@ extern u_int32_t mptramp_pagetables; extern int mp_naps; extern int boot_cpu_id; extern struct pcb stoppcbs[]; -extern struct mtx smp_tlb_mtx; extern int cpu_apic_ids[]; /* IPI handlers */ diff --git a/sys/i386/include/smp.h b/sys/i386/include/smp.h index a75ff97c1c45..264fb7ffe659 100644 --- a/sys/i386/include/smp.h +++ b/sys/i386/include/smp.h @@ -35,7 +35,6 @@ void bootMP(void); extern int mp_naps; extern int boot_cpu_id; extern struct pcb stoppcbs[]; -extern struct mtx smp_tlb_mtx; extern int cpu_apic_ids[]; #ifdef COUNT_IPIS extern u_long *ipi_invltlb_counts[MAXCPU]; diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index e16e38ee9f62..8ff7092a6580 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -586,7 +586,6 @@ runq_remove_idx(struct runq *rq, struct td_sched *ts, u_char *idx) /****** functions that are temporarily here ***********/ #include -extern struct mtx kse_zombie_lock; /* * Allocate scheduler specific per-process resources. diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index a8a35813c3dc..b0032572290e 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -70,7 +70,7 @@ int virtual_cpu; #endif TAILQ_HEAD(, thread) zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads); -struct mtx zombie_lock; +static struct mtx zombie_lock; MTX_SYSINIT(zombie_lock, &zombie_lock, "zombie lock", MTX_SPIN); static void thread_zombie(struct thread *); diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 7b51cc61c3ec..c46bf94294a5 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -406,7 +406,6 @@ static struct witness_order_list_entry order_lists[] = { { "sio", &lock_class_mtx_spin }, #ifdef __i386__ { "cy", &lock_class_mtx_spin }, - { "descriptor tables", &lock_class_mtx_spin }, #endif #ifdef __sparc64__ { "pcib_mtx", &lock_class_mtx_spin }, @@ -430,22 +429,22 @@ static struct witness_order_list_entry order_lists[] = { { "entropy harvest mutex", &lock_class_mtx_spin }, { "syscons video lock", &lock_class_mtx_spin }, { "time lock", &lock_class_mtx_spin }, +#ifdef SMP + { "smp rendezvous", &lock_class_mtx_spin }, +#endif /* * leaf locks */ - { "allpmaps", &lock_class_mtx_spin }, { "icu", &lock_class_mtx_spin }, -#ifdef SMP - { "smp rendezvous", &lock_class_mtx_spin }, -#if defined(__i386__) || defined(__amd64__) - { "tlb", &lock_class_mtx_spin }, -#endif -#ifdef __sparc64__ +#if defined(SMP) && defined(__sparc64__) { "ipi", &lock_class_mtx_spin }, #endif +#ifdef __i386__ + { "allpmaps", &lock_class_mtx_spin }, + { "descriptor tables", &lock_class_mtx_spin }, #endif { "clk", &lock_class_mtx_spin }, - { "mutex profiling lock", &lock_class_mtx_spin }, + { "mprof lock", &lock_class_mtx_spin }, { "kse lock", &lock_class_mtx_spin }, { "zombie lock", &lock_class_mtx_spin }, { "ALD Queue", &lock_class_mtx_spin },