Optional MPSAFE syscalls aren't

Kris Kennaway kris at obsecurity.org
Sun Jun 11 20:41:21 UTC 2006

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-smp/attachments/20060611/b3e931b6/attachment.pgp

More information about the freebsd-smp mailing list