From owner-freebsd-bugs@FreeBSD.ORG Sun Aug 29 12:00:24 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D510810656D0 for ; Sun, 29 Aug 2010 12:00:24 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AAA2E8FC0C for ; Sun, 29 Aug 2010 12:00:24 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o7TC0O0f053082 for ; Sun, 29 Aug 2010 12:00:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7TC0ONu053064; Sun, 29 Aug 2010 12:00:24 GMT (envelope-from gnats) Date: Sun, 29 Aug 2010 12:00:24 GMT Message-Id: <201008291200.o7TC0ONu053064@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Kostik Belousov Cc: Subject: Re: kern/131597: [kernel] c++ exceptions very slow on FreeBSD 7.1/amd64 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Kostik Belousov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Aug 2010 12:00:24 -0000 The following reply was made to PR kern/131597; it has been noted by GNATS. From: Kostik Belousov To: David Xu Cc: bug-followup@freebsd.org, guillaume@morinfr.org, John Baldwin Subject: Re: kern/131597: [kernel] c++ exceptions very slow on FreeBSD 7.1/amd64 Date: Sun, 29 Aug 2010 14:57:56 +0300 --siH5g6X9/kbebbtM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 29, 2010 at 02:55:32PM +0800, David Xu wrote: > Without the previous signal wrapper patch I posted (I am not sure > I will use it, because it is too complex), I think there is another way > to avoid sigprocmask, I have ever written a system call >=20 > sc_shared_t *schedctl(void); >=20 >=20 > which returns shared data area between userland and kernel. > userland code sets a flag in the data area to disable signal delivering. > when kernel code wants to deliver signal, it also checks the flag, and > does not deliver signals if the flag is set, then the problem would be=20 > fixed: > http://people.freebsd.org/~davidxu/schedctl/ >=20 I only skimmed over the (incomplete) change. It seems it has issues with rfork(). In particular, when shared vm space between two processes becomes forked. Also, it is not clear to me what would happen if the shared page paged out or user mode explicitely unmap(2) the shared region. At least the kernel mapping should be invalidated, otherwise kernel might modify random memory. I do not like the idea of using additional non-observable state bits, in addition to the signal mask, to block the signal delivery. IMHO, it subverts the signal mechanism, and, in case of memory corruption, makes debugging too hard. --siH5g6X9/kbebbtM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkx6S0QACgkQC3+MBN1Mb4iR0ACgvk00JTKvHNa01CmoJCJCeT+D 8F8An0rCa1Z3ZbLlLgi1UC8ICZCxczv0 =LWTr -----END PGP SIGNATURE----- --siH5g6X9/kbebbtM--