On Sat, 2 Jun 2018, Christophe Prévotaux wrote:
> This a witness report I got on boot with snapshot Jun 1st amd64
>
> root on sd0a (9b49e3196b9bfae8.a) swap on sd0b dump on sd0b
> lock order reversal:
>  1st 0xffffff021cdac180 vmmaplk (&map->lock) @ /usr/src/sys/uvm/uvm_map.c:4433
>  2nd 0xffffff01dc5f71a8 inode (&ip->i_lock)

I believe uvm and the vnode layer handle this correctly, with lock tries 
that fall back to releasing the other lock and retrying so progress is 
made.  The fix for WITNESS complaining is to mark vmmaplk as a vnode lock.

ok?

Index: uvm/uvm_map.c
===================================================================
RCS file: /data/src/openbsd/src/sys/uvm/uvm_map.c,v
retrieving revision 1.237
diff -u -p -r1.237 uvm_map.c
--- uvm/uvm_map.c       18 Apr 2018 16:05:21 -0000      1.237
+++ uvm/uvm_map.c       20 Apr 2018 02:22:26 -0000
@@ -2552,7 +2552,7 @@ uvm_map_setup(struct vm_map *map, vaddr_
        map->s_start = map->s_end = 0; /* Empty stack area by default. */
        map->flags = flags;
        map->timestamp = 0;
-       rw_init_flags(&map->lock, "vmmaplk", RWL_DUPOK);
+       rw_init_flags(&map->lock, "vmmaplk", RWL_DUPOK | RWL_IS_VNODE);
        mtx_init(&map->mtx, IPL_VM);
        mtx_init(&map->flags_lock, IPL_VM);
 

Reply via email to