From owner-freebsd-smp@FreeBSD.ORG Mon Jun 12 13:28:29 2006 Return-Path: X-Original-To: freebsd-smp@freebsd.org Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF87116A41B; Mon, 12 Jun 2006 13:28:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DE8843D55; Mon, 12 Jun 2006 13:28:29 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from osx.baldwin.cx (osx.baldwin.cx [192.168.0.15]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k5CDSNV7012219; Mon, 12 Jun 2006 09:28:28 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-smp@freebsd.org Date: Mon, 12 Jun 2006 08:59:39 -0400 User-Agent: KMail/1.9.1 References: <20060611204118.GA34272@xor.obsecurity.org> In-Reply-To: <20060611204118.GA34272@xor.obsecurity.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606120859.40898.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Mon, 12 Jun 2006 09:28:28 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1534/Mon Jun 12 08:30:53 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: smp@freebsd.org, alfred@freebsd.org, current@freebsd.org, Kris Kennaway Subject: Re: Optional MPSAFE syscalls aren't X-BeenThere: freebsd-smp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD SMP implementation group List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jun 2006 13:28:30 -0000 On Sunday 11 June 2006 16:41, Kris Kennaway wrote: > 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. I actually plan to just remove the SYF_MPSAFE flag soon anyways and just push Giant down manually into the handful of syscalls that still need it. -- John Baldwin