From owner-freebsd-current@FreeBSD.ORG Sun Jun 11 20:41:21 2006 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F71516A473; Sun, 11 Jun 2006 20:41:21 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB03A43D49; Sun, 11 Jun 2006 20:41:19 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 6F91C1A4DA2; Sun, 11 Jun 2006 13:41:19 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id D61C8516F6; Sun, 11 Jun 2006 16:41:18 -0400 (EDT) Date: Sun, 11 Jun 2006 16:41:18 -0400 From: Kris Kennaway To: current@FreeBSD.org, smp@FreeBSD.org Message-ID: <20060611204118.GA34272@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8t9RHnE3ZwKMSgU+" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Cc: alfred@FreeBSD.org Subject: Optional MPSAFE syscalls aren't X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jun 2006 20:41:21 -0000 --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+--