Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Mar 2009 16:06:06 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/security/mac mac_atalk.c mac_audit.c mac_cred.c mac_framework.c mac_inet.c mac_inet6.c mac_internal.h mac_net.c mac_pipe.c mac_posix_sem.c mac_posix_shm.c mac_priv.c mac_process.c mac_socket.c mac_syscalls.c mac_system.c ...
Message-ID:  <200903141606.n2EG6RZ5029149@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
rwatson     2009-03-14 16:06:06 UTC

  FreeBSD src repository

  Modified files:
    sys/security/mac     mac_atalk.c mac_audit.c mac_cred.c 
                         mac_framework.c mac_inet.c mac_inet6.c 
                         mac_internal.h mac_net.c mac_pipe.c 
                         mac_posix_sem.c mac_posix_shm.c 
                         mac_priv.c mac_process.c mac_socket.c 
                         mac_syscalls.c mac_system.c 
                         mac_sysv_msg.c mac_sysv_sem.c 
                         mac_sysv_shm.c mac_vfs.c 
  Log:
  SVN rev 189797 on 2009-03-14 16:06:06Z by rwatson
  
  Rework MAC Framework synchronization in a number of ways in order to
  improve performance:
  
  - Eliminate custom reference count and condition variable to monitor
    threads entering the framework, as this had both significant overhead
    and behaved badly in the face of contention.
  
  - Replace reference count with two locks: an rwlock and an sx lock,
    which will be read-acquired by threads entering the framework
    depending on whether a give policy entry point is permitted to sleep
    or not.
  
  - Replace previous mutex locking of the reference count for exclusive
    access with write acquiring of both the policy list sx and rw locks,
    which occurs only when policies are attached or detached.
  
  - Do a lockless read of the dynamic policy list head before acquiring
    any locks in order to reduce overhead when no dynamic policies are
    loaded; this a race we can afford to lose.
  
  - For every policy entry point invocation, decide whether sleeping is
    permitted, and if not, use a _NOSLEEP() variant of the composition
    macros, which will use the rwlock instead of the sxlock.  In some
    cases, we decide which to use based on allocation flags passed to the
    MAC Framework entry point.
  
  As with the move to rwlocks/rmlocks in pfil, this may trigger witness
  warnings, but these should (generally) be false positives as all
  acquisition of the locks is for read with two very narrow exceptions
  for policy load/unload, and those code blocks should never acquire
  other locks.
  
  Sponsored by:   Google, Inc.
  Obtained from:  TrustedBSD Project
  Discussed with: csjp (idea, not specific patch)
  
  Revision  Changes    Path
  1.2       +6 -2      src/sys/security/mac/mac_atalk.c
  1.7       +5 -5      src/sys/security/mac/mac_audit.c
  1.4       +17 -17    src/sys/security/mac/mac_cred.c
  1.143     +72 -111   src/sys/security/mac/mac_framework.c
  1.24      +45 -28    src/sys/security/mac/mac_inet.c
  1.4       +16 -9     src/sys/security/mac/mac_inet6.c
  1.128     +80 -19    src/sys/security/mac/mac_internal.h
  1.134     +23 -16    src/sys/security/mac/mac_net.c
  1.116     +12 -10    src/sys/security/mac/mac_pipe.c
  1.17      +9 -9      src/sys/security/mac/mac_posix_sem.c
  1.4       +10 -9     src/sys/security/mac/mac_posix_shm.c
  1.6       +2 -2      src/sys/security/mac/mac_priv.c
  1.131     +5 -5      src/sys/security/mac/mac_process.c
  1.15      +34 -26    src/sys/security/mac/mac_socket.c
  1.139     +8 -4      src/sys/security/mac/mac_syscalls.c
  1.115     +7 -7      src/sys/security/mac/mac_system.c
  1.13      +18 -13    src/sys/security/mac/mac_sysv_msg.c
  1.12      +9 -8      src/sys/security/mac/mac_sysv_sem.c
  1.11      +12 -10    src/sys/security/mac/mac_sysv_shm.c
  1.130     +19 -16    src/sys/security/mac/mac_vfs.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903141606.n2EG6RZ5029149>