witness oddity

From: Andrew Gallatin <gallatin_at_cs.duke.edu>
Date: Fri, 10 Sep 2004 13:18:06 -0400 (EDT)
I'm trying to figure out what witness is complaining about in my (out
of tree) driver code:

lock order reversal
 1st 0xe672baf0 MX foo mutex (MX foo mutex) _at_ /home/gallatin/mx/tiki/driver/freebsd/../common/mx_common.c:80
 2nd 0xc1c6f878 user map (user map) _at_ vm/vm_map.c:2994



If I call copyout() holding one of my mutexes, it will always complain
about a LOR, even if the mutex is freshly initiated:

  {
    struct mtx foo;

    bzero(&foo, sizeof(foo));
    mtx_init(&foo, "MX foo mutex", NULL, MTX_DEF);
    mtx_lock(&foo);
    /* hacky copyout which should trigger vm_fault() */
    mx_copyout(&status, 1, 4);
    mtx_unlock(&foo);
    mtx_destroy(&foo);
  }


Is this happening because the vm_map "user map" is an sx lock?

Does this imply that you can't acquire an sx lock while holding a mutex?

Thanks,

Drew
Received on Fri Sep 10 2004 - 15:18:12 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:11 UTC