From owner-freebsd-fs@freebsd.org Sat Nov 28 13:30:03 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 D7082A3BB97 for ; Sat, 28 Nov 2015 13:30:03 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 9142A1A76 for ; Sat, 28 Nov 2015 13:30:02 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:DunM5BFziuQyy79EVdNF8J1GYnF86YWxBRYc798ds5kLTJ75oMqwAkXT6L1XgUPTWs2DsrQf27eQ4/2rAzNIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/niqbiptaJPE1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv+YJa6jxfrw5QLpEF3xmdjltvIy4/SXEGCWV63Y2aUlevCEAVwbf4RzwRZu0vDDSuPBw1SOBMYvxV79iChq46KI+ch7ji28iPjU69GzSwphqiatQoxasojRixIHJbYWNNLx1d/WOLpshWWNdU5MJBGR6CYSmYt5KVrJZMA== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DNAQD+qllW/61jaINehQOvLo5rAQ2BZoYPgWEUAQEBAQEBAQGBCYItgg4jBGQBIgINGQJbBIhBnDmPcI9EDCGBAYVTiUKDMYFEBY0idog/qhcCHwEBQoIQAR2BdCCEXEKBBwEBAQ X-IronPort-AV: E=Sophos;i="5.20,356,1444708800"; d="scan'208";a="254602129" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 28 Nov 2015 08:29:55 -0500 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id E063F15F5E3 for ; Sat, 28 Nov 2015 08:29:55 -0500 (EST) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id D9HcOlyvRxLN for ; Sat, 28 Nov 2015 08:29:55 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 80F2115F5ED for ; Sat, 28 Nov 2015 08:29:55 -0500 (EST) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id dirk-PPcPc8m for ; Sat, 28 Nov 2015 08:29:55 -0500 (EST) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 5D14A15F5E3 for ; Sat, 28 Nov 2015 08:29:55 -0500 (EST) Date: Sat, 28 Nov 2015 08:29:55 -0500 (EST) From: Rick Macklem To: FreeBSD FS Message-ID: <2132881382.109600978.1448717395325.JavaMail.zimbra@uoguelph.ca> Subject: should mutexes be uniquely named? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.12] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF34 (Win)/8.0.9_GA_6191) Thread-Topic: should mutexes be uniquely named? Thread-Index: YHpHNcYauUF2pc+LMGoIiRXKLcF0zw== 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 13:30:03 -0000 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.) 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.