Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jun 2009 10:36:22 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r193332 - in head/sys: kern netatalk netinet rpc security/mac
Message-ID:  <20090603083622.GA3824@garage.freebsd.pl>
In-Reply-To: <200906021826.n52IQHrh024410@svn.freebsd.org>
References:  <200906021826.n52IQHrh024410@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 02, 2009 at 06:26:17PM +0000, Robert Watson wrote:
> Author: rwatson
> Date: Tue Jun  2 18:26:17 2009
> New Revision: 193332
> URL: http://svn.freebsd.org/changeset/base/193332
>=20
> Log:
>   Add internal 'mac_policy_count' counter to the MAC Framework, which is a
>   count of the number of registered policies.
>  =20
>   Rather than unconditionally locking sockets before passing them into MA=
C,
>   lock them in the MAC entry points only if mac_policy_count is non-zero.
>  =20
>   This avoids locking overhead for a number of socket system calls when no
>   policies are registered, eliminating measurable overhead for the MAC
>   Framework for the socket subsystem when there are no active policies.
>  =20
>   Possibly socket locks should be acquired by policies if they are requir=
ed
>   for socket labels, which would further avoid locking overhead when there
>   are policies but they don't require labeling of sockets, or possibly
>   don't even implement socket controls.

This may introduce further overhead if there are few policies that
implement socket controls. Then you will have cost of npolicies * lock/unlo=
ck.
Maybe we could check if there is at least one policy implementing
particular socket control and if yes lock the socket in the framework
only once? This won't be ideal (there might be socket control that
doesn't need to lock the socket), but is good enough for my taste:)

--=20
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--2oS5YaxWCcQjTEyO
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFKJjYGForvXbEpPzQRAt2GAKChKnv6ZaUq1YSsRutbx0zLReVnawCfePZM
KcfsAcGfd6Qa+FhQeYDQpzY=
=vTmO
-----END PGP SIGNATURE-----

--2oS5YaxWCcQjTEyO--



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