From 552b3e179847f3cd44ce4dcd2c273f6ff1c8d6b0 Mon Sep 17 00:00:00 2001 From: Matt Macy Date: Mon, 28 May 2018 23:14:38 +0000 Subject: [PATCH] witness/hwpmc: fix locking order for pmc locks --- sys/kern/subr_witness.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 33a103ec715..9edec343e39 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -499,12 +499,12 @@ static struct witness_order_list_entry order_lists[] = { { "pipe mutex", &lock_class_mtx_sleep }, { "sigio lock", &lock_class_mtx_sleep }, { "process group", &lock_class_mtx_sleep }, - { "process lock", &lock_class_mtx_sleep }, - { "session", &lock_class_mtx_sleep }, - { "uidinfo hash", &lock_class_rw }, #ifdef HWPMC_HOOKS { "pmc-sleep", &lock_class_mtx_sleep }, #endif + { "process lock", &lock_class_mtx_sleep }, + { "session", &lock_class_mtx_sleep }, + { "uidinfo hash", &lock_class_rw }, { "time lock", &lock_class_mtx_sleep }, { NULL, NULL }, /* @@ -671,9 +671,6 @@ static struct witness_order_list_entry order_lists[] = { { "uart_hwmtx", &lock_class_mtx_spin }, { "fast_taskqueue", &lock_class_mtx_spin }, { "intr table", &lock_class_mtx_spin }, -#ifdef HWPMC_HOOKS - { "pmc-per-proc", &lock_class_mtx_spin }, -#endif { "process slock", &lock_class_mtx_spin }, { "syscons video lock", &lock_class_mtx_spin }, { "sleepq chain", &lock_class_mtx_spin }, @@ -690,6 +687,12 @@ static struct witness_order_list_entry order_lists[] = { #ifdef __powerpc__ { "tlb0", &lock_class_mtx_spin }, #endif + { NULL, NULL }, + { "sched lock", &lock_class_mtx_spin }, +#ifdef HWPMC_HOOKS + { "pmc-per-proc", &lock_class_mtx_spin }, +#endif + { NULL, NULL }, /* * leaf locks */