From a8b2ff5af71d9d7536b37f7255566c36f5bccf1f Mon Sep 17 00:00:00 2001 From: andre Date: Fri, 26 Oct 2012 17:31:35 +0000 Subject: [PATCH] Move the corresponding MTX_SYSINIT() next to their struct mtx declaration to make their relationship more obvious as done with the other such mutexs. --- sys/vm/vm_glue.c | 3 ++- sys/xen/evtchn/evtchn.c | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index ef443517c142..f44f04c78d9c 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -307,6 +307,8 @@ struct kstack_cache_entry *kstack_cache; static int kstack_cache_size = 128; static int kstacks; static struct mtx kstack_cache_mtx; +MTX_SYSINIT(kstack_cache, &kstack_cache_mtx, "kstkch", MTX_DEF); + SYSCTL_INT(_vm, OID_AUTO, kstack_cache_size, CTLFLAG_RW, &kstack_cache_size, 0, ""); SYSCTL_INT(_vm, OID_AUTO, kstacks, CTLFLAG_RD, &kstacks, 0, @@ -486,7 +488,6 @@ kstack_cache_init(void *nulll) EVENTHANDLER_PRI_ANY); } -MTX_SYSINIT(kstack_cache, &kstack_cache_mtx, "kstkch", MTX_DEF); SYSINIT(vm_kstacks, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, kstack_cache_init, NULL); #ifndef NO_SWAPPING diff --git a/sys/xen/evtchn/evtchn.c b/sys/xen/evtchn/evtchn.c index b4053eb0c49e..eb18b57602c9 100644 --- a/sys/xen/evtchn/evtchn.c +++ b/sys/xen/evtchn/evtchn.c @@ -44,7 +44,15 @@ static inline unsigned long __ffs(unsigned long word) return word; } +/* + * irq_mapping_update_lock: in order to allow an interrupt to occur in a critical + * section, to set pcpu->ipending (etc...) properly, we + * must be able to get the icu lock, so it can't be + * under witness. + */ static struct mtx irq_mapping_update_lock; +MTX_SYSINIT(irq_mapping_update_lock, &irq_mapping_update_lock, "xp", MTX_SPIN); + static struct xenpic *xp; struct xenpic_intsrc { struct intsrc xp_intsrc; @@ -1130,11 +1138,4 @@ evtchn_init(void *dummy __unused) } SYSINIT(evtchn_init, SI_SUB_INTR, SI_ORDER_MIDDLE, evtchn_init, NULL); - /* - * irq_mapping_update_lock: in order to allow an interrupt to occur in a critical - * section, to set pcpu->ipending (etc...) properly, we - * must be able to get the icu lock, so it can't be - * under witness. - */ -MTX_SYSINIT(irq_mapping_update_lock, &irq_mapping_update_lock, "xp", MTX_SPIN);