From owner-freebsd-bugs@FreeBSD.ORG Fri Jun 28 16:00:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46B7342E for ; Fri, 28 Jun 2013 16:00:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 395581627 for ; Fri, 28 Jun 2013 16:00:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r5SG02pN041269 for ; Fri, 28 Jun 2013 16:00:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r5SG02G9041268; Fri, 28 Jun 2013 16:00:02 GMT (envelope-from gnats) Date: Fri, 28 Jun 2013 16:00:02 GMT Message-Id: <201306281600.r5SG02G9041268@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: John Baldwin 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.14 Precedence: list Reply-To: John Baldwin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2013 16:00:02 -0000 The following reply was made to PR kern/131597; it has been noted by GNATS. From: John Baldwin To: bug-followup@freebsd.org, guillaume@morinfr.org Cc: kib@freebsd.org, theraven@freebsd.org Subject: Re: kern/131597: [kernel] c++ exceptions very slow on FreeBSD 7.1/amd64 Date: Fri, 28 Jun 2013 08:47:55 -0400 Looking at this again, the patch committed in 178807 is just wrong and should be reverted. There is no state in rtld that needs to be protected via a write lock. GCC is too lazy to use their own locking to protect shared state between threads and wants the runtime linker to enforce this. Their justification that glibc doesn't allow concurrent execution of this isn't a valid excuse. For an API like this that just walks a list and invokes a callback, if the callback manipulates shared state owned by the caller, the caller should be responsible for sychronizing access to it, not rtld! Instead I think we should apply the patch in the original GCC bug to our in- tree GCC and to our GCC ports. This should remove the sigprocmask calls and not penalize other users of dl_iterate_phdr() for GCC's poor behavior. -- John Baldwin