From owner-freebsd-arch@FreeBSD.ORG Mon Jun 2 05:09:31 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 899EE106567F for ; Mon, 2 Jun 2008 05:09:31 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outP.internet-mail-service.net (outp.internet-mail-service.net [216.240.47.239]) by mx1.freebsd.org (Postfix) with ESMTP id 62AD78FC18 for ; Mon, 2 Jun 2008 05:09:31 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 1CE21248B; Sun, 1 Jun 2008 22:09:31 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id C9D412D6017; Sun, 1 Jun 2008 22:09:30 -0700 (PDT) Message-ID: <4843808A.2060501@elischer.org> Date: Sun, 01 Jun 2008 22:09:30 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Daniel Eischen References: <483EE7D5.5050408@elischer.org> <20080601215759.GN64397@hoeg.nl> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Ed Schouten , arch@freebsd.org Subject: Re: all mutexes -> read-write locks? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2008 05:09:31 -0000 Daniel Eischen wrote: > On Sun, 1 Jun 2008, Ed Schouten wrote: > >> Hello Julian, >> >> * Julian Elischer wrote: >>> it has been mentioned several times that through the evolution of the >>> locking primitives it has come to be that mutexes and exclusively >>> acquired reader-writer locks are almost the same in terms of overhead >>> and that it might be a good move to define all mutexes to be >>> actually just that. >>> >>> this would allow people to slowly go through the system, catching low >>> hanging fruit by converting some of the mutex operations to reader >>> acquisitions wherever a writer is not required, thus reducing general >>> system contention. >>> >>> Is there any thought on this? Last I heard jhb had confirmed that it >>> was feasible.. >> >> If this is going to be done, could we have mtx_* macro's pointing to the >> proper read/write ops? I know, it's just names, but I think most novice >> FreeBSD kernel hackers will almost instantaneously figure out what 'mtx' >> stands for. > > Yes, mutex (mtx) is known very well. > > I don't think changing all mutex operations to rdlock operations > is wise. They are two different animals, regardless of their > implementation. Mutexes are very commonly used in device drivers, > at least outside of FreeBSD. And just because our current > implementation of them are the same as rwlocks doesn't mean that > it will always be the same in the future. > so let's imagine that mutexes dissappear... :-)