Index: share/man/man9/rmlock.9 =================================================================== --- share/man/man9/rmlock.9 +++ share/man/man9/rmlock.9 @@ -186,6 +186,9 @@ has not been initialized multiple times without intervening calls to .Fn rm_destroy unless this option is specified. +.It Dv RM_DUPOK +.Xr witness 4 +should not log messages about duplicate locks being acquired. .El .It Fn rm_rlock "struct rmlock *rm" "struct rm_priotracker* tracker" Lock Index: sys/kern/kern_rmlock.c =================================================================== --- sys/kern/kern_rmlock.c +++ sys/kern/kern_rmlock.c @@ -289,6 +289,8 @@ liflags |= LO_RECURSABLE; if (opts & RM_NEW) liflags |= LO_NEW; + if (opts & RM_DUPOK) + liflags |= LO_DUPOK; rm->rm_writecpus = all_cpus; LIST_INIT(&rm->rm_activeReaders); if (opts & RM_SLEEPABLE) { Index: sys/sys/rmlock.h =================================================================== --- sys/sys/rmlock.h +++ sys/sys/rmlock.h @@ -48,6 +48,7 @@ #define RM_RECURSE 0x00000002 #define RM_SLEEPABLE 0x00000004 #define RM_NEW 0x00000008 +#define RM_DUPOK 0x00000010 void rm_init(struct rmlock *rm, const char *name); void rm_init_flags(struct rmlock *rm, const char *name, int opts);