CFR: patch to support creation of multiple mutex pools

Don Lewis truckman at
Wed Jul 9 11:41:47 PDT 2003

The patch below enhances the mutex pool code to support the creation and
use of multiple mutex pools.  It creates one pool of sleep mutexes with
the MTX_NOWITNESS flag for use in building higher level (sx and lockmgr)
locks. It also creates another pool without MTX_NOWITNESS for general
purpose use. It can also be used to create pools of spin mutexes.

The users of the existing MTX_NOWITNESS pool are modified to use the
appropriate pool.

If this had been implemented earlier, it would have allowed witness to
catch the Giant vs. FILE_LOCK() lock order reversal that I recently
tracked down and fixed.

I've tested this only on i386, but it also passes the "make universe"

More information about the freebsd-current mailing list