cvs commit: src/sys/kern subr_witness.c src/sys/sys _lock.h lock.h

John Baldwin jhb at
Mon Dec 5 12:45:45 PST 2005

jhb         2005-12-05 20:45:24 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             subr_witness.c 
    sys/sys              _lock.h lock.h 
  Tweak witness handling of lock object to shave 2 pointers off of each
  lock object (and thus off of each mutex and sx lock):
  - Rename the all_locks list to pending_locks and only put locks initialized
    before SI_SUB_WITNESS on the list so that the SI_SUB_WITNESS can add them
    to witness once it starts up.
  - Now that pending_locks is only used during early startup, change it from
    a TAILQ to an STAILQ.  This removes a pointer from the STAILQ_ENTRY in
    struct lock_object.
  - Since the pending_locks list is only used during the single-threaded
    early boot it no longer needs to be protected by a mutex, so remove
  - Since the lo_list member of struct lock_object is now only used during
    early boot before witness is running, collapse lo_list and lo_witness
    into a union.  This shaves the second pointer off of struct lock_object.
  - Axe lock_cur_cnt and lock_max_cnt.
  With these changes, struct mtx shrinks from 36 to 28 bytes on 32-bit
  platforms and from 72 to 56 bytes on 64-bit platforms.  Note that this
  commit will completely and utterly destroy the kernel ABI, so no MFC.
  Tested on:      alpha, amd64, i386, sparc64
  Revision  Changes    Path
  1.207     +44 -44    src/sys/kern/subr_witness.c
  1.11      +4 -2      src/sys/sys/_lock.h
  1.53      +1 -0      src/sys/sys/lock.h

More information about the cvs-src mailing list