From owner-freebsd-fs@freebsd.org Sat Nov 28 14:26:10 2015 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89802A3B577 for ; Sat, 28 Nov 2015 14:26:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 060111F4B for ; Sat, 28 Nov 2015 14:26:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tASEQ4tl047822 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 28 Nov 2015 16:26:05 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tASEQ4tl047822 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tASEQ4ja047821; Sat, 28 Nov 2015 16:26:04 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Nov 2015 16:26:04 +0200 From: Konstantin Belousov To: Rick Macklem Cc: FreeBSD FS Subject: Re: should mutexes be uniquely named? Message-ID: <20151128142604.GW3448@kib.kiev.ua> References: <2132881382.109600978.1448717395325.JavaMail.zimbra@uoguelph.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2132881382.109600978.1448717395325.JavaMail.zimbra@uoguelph.ca> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2015 14:26:10 -0000 On Sat, Nov 28, 2015 at 08:29:55AM -0500, Rick Macklem wrote: > Hi, > > I think the patches I posted last week that add "-manage-gids" are about > ready for a commit to head. > > However, there is one place in the code where I'm not sure which is better > to do: > --> The code replaces a single mutex with one for each hash list head (table > entry). > I currently use MTX_DUPOK and call them all the same thing. > or > I could add a "lockname" field to the hash table enty structure and give > each one a unique name (similar to what Garrett Wollman did in the kernel rpc). > The only downside to this is 16bytes of storage for each hash table entry. > (Admittedly, I don't think many sites would need to set the hash table size > greater than a few thousand, so this isn't a lot of malloc()'d memory.) Question is, why do you need to acquire two mutexes simultaneously ? If mutexes protect the hash list rooted in head, then this is somewhat unusual. Downside is not only the name, but also a witness overhead in the non-production kernels. > > So, what do you think. Should I add the code to make the mutex names unique? > > Thanks in advance for any comments, rick > ps: The coding change is trivial. It just involves using more malloc()'d memory. > _______________________________________________ > freebsd-fs@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"