Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jun 2006 16:41:18 -0400
From:      Kris Kennaway <kris@obsecurity.org>
To:        current@FreeBSD.org, smp@FreeBSD.org
Cc:        alfred@FreeBSD.org
Subject:   Optional MPSAFE syscalls aren't
Message-ID:  <20060611204118.GA34272@xor.obsecurity.org>

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

--8t9RHnE3ZwKMSgU+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

rwatson, pjd and I tracked down the following problem when looking at
postgresql profiling traces:

For syscalls that are part of subsystems that may be loaded from kld,
the SYSCALL_MODULE_HELPER() spams the copy of the sysent from
syscalls.master - and it never sets the SYF_MPSAFE flag.  This means
that regardless of what syscalls.master says about mpsafety, such
syscalls always acquire Giant.

One sad consequence of this is that when I removed the
SYSCALL_MODULE_HELPERs from sysv_sem.c to get rid of the bogus Giant
locking that seems to be hurting performance, postgresql hangs when
trying to start; possibly the locking in sysv_sem.c is just broken
since it was always implicitly serialized by Giant, so never in fact
tested at all.

Apart from the SYSV IPC syscalls, this also affects the AIO and mqueue
code.

Kris

--8t9RHnE3ZwKMSgU+
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (FreeBSD)

iD8DBQFEjH/tWry0BWjoQKURAnOBAJwIjkCtdgOX2xYvSICPMIvRmNyixwCfQVKo
05fj0qqtGsccpp9SO+w07yg=
=PPG4
-----END PGP SIGNATURE-----

--8t9RHnE3ZwKMSgU+--



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