From owner-freebsd-arch@FreeBSD.ORG Wed Jan 16 00:30:39 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 099CD997; Wed, 16 Jan 2013 00:30:39 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx1.freebsd.org (Postfix) with ESMTP id A8B8189A; Wed, 16 Jan 2013 00:30:38 +0000 (UTC) Received: by mail-pa0-f46.google.com with SMTP id bh2so433900pad.5 for ; Tue, 15 Jan 2013 16:30:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:reply-to:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=cYvtlBtpMeYM3HqF+sARSGxitLS5o0WxtfxLkJus1TE=; b=uu3F3jpjuMOxPGmbGLSULzU836KHfdkJCq7xYoygksrjvd8c3r90BC01fygqQFqsIx OeMyEkZqhnf78aWKza+QSZptZZOPDDWk0kD6JLa2ecyoL2FhITZw5spKujJJuUq2nLDN zwJ+Pv7fhSfsbHKELvNVCQxrRIuvpxp6GYZFRdJEO9Yr4Ld14CN7TEqhoPIzQ0G3EN8h h4svv6wTEark7zySAJ4CGyaJZx+7MxPuVLiIP+QxPr+Tg5NbnI19tiIDSRtCB66mv1hn ZzosoQtgyEqcF8FGfU49YjomFz9EDOQqUqksxjZ5DHfRopGJrGNBk6/8Va9Z4/3x/Kj7 Ec0A== X-Received: by 10.68.252.4 with SMTP id zo4mr273293689pbc.126.1358296233913; Tue, 15 Jan 2013 16:30:33 -0800 (PST) Received: from xp5k.my.domain ([115.192.139.240]) by mx.google.com with ESMTPS id kl3sm11114067pbc.15.2013.01.15.16.30.29 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jan 2013 16:30:32 -0800 (PST) Message-ID: <50F5F4A2.6080200@gmail.com> Date: Wed, 16 Jan 2013 08:30:26 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: Fast sigblock (AKA rtld speedup) References: <20130107182235.GA65279@kib.kiev.ua> <201301141358.33216.jhb@freebsd.org> <201301151445.26895.jhb@freebsd.org> In-Reply-To: <201301151445.26895.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: toolchain@freebsd.org, David Chisnall , Jilles Tjoelker , freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: davidxu@freebsd.org List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2013 00:30:39 -0000 On 2013/01/16 03:45, John Baldwin wrote: > On Tuesday, January 15, 2013 4:21:25 am David Chisnall wrote: >> On 14 Jan 2013, at 18:58, John Baldwin wrote: >> >>> I'm less certain. Note that you can't inline mutex ops until you expose >>> the mutexes themselves to userland (that is, making pthread_mutex_t not >>> be opaque). >> This is one of the things that will be required anyway if we wish to support > process-shared mutexes (they've been in POSIX since 1997, so it's probably > getting on for time we did), as the current mutex-is-a-pointer implementation > depends on the virtual address space of the creator, and so does not work if > the mutex is created in a shared memory segment. > > Yes, David Xu has a p4 branch with this done already. My point is that I > would rather effort be spent on getting that in before attempting your > suggestion for our current primitives as the inlining you do now requires > that David's changes honor the same ABI in the future. > Yes, I have such a p4 branch. The problem I encountered is binary compatibility, libthr has to have both code for old mutex which is a pointer and new mutex which is a structure, if module A passes pointer-mutex to a recompiled module B which is using structure-mutex, this is broken. And I found NVIDIA GeForce driver is using dlsym() with no version hint, it is trying to get pthread_mutex_lock and other symbols, the default version in the new libthr will return a new entry which uses structure mutex, since the driver is not open-source, so you can not recompile it, the change will break it. Regards, David Xu