From owner-freebsd-threads@freebsd.org Fri May 13 22:34:38 2016 Return-Path: Delivered-To: freebsd-threads@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 38B69B3A198 for ; Fri, 13 May 2016 22:34:38 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 22E991EED for ; Fri, 13 May 2016 22:34:38 +0000 (UTC) (envelope-from jilles@stack.nl) Received: by mailman.ysv.freebsd.org (Postfix) id 1ABD0B3A196; Fri, 13 May 2016 22:34:38 +0000 (UTC) Delivered-To: threads@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 1A289B3A194; Fri, 13 May 2016 22:34:38 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DA77E1EEB; Fri, 13 May 2016 22:34:37 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from toad2.stack.nl (toad2.stack.nl [IPv6:2001:610:1108:5010::161]) by mx1.stack.nl (Postfix) with ESMTP id 82C52358C5C; Sat, 14 May 2016 00:34:34 +0200 (CEST) Received: by toad2.stack.nl (Postfix, from userid 1677) id E9300892FF; Sat, 14 May 2016 00:34:34 +0200 (CEST) Date: Sat, 14 May 2016 00:34:34 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: threads@freebsd.org, arch@freebsd.org Subject: Re: Robust mutexes implementation Message-ID: <20160513223434.GA47987@stack.nl> References: <20160505131029.GE2422@kib.kiev.ua> <20160506233011.GA99994@stack.nl> <20160507165956.GC89104@kib.kiev.ua> <20160508125222.GA48862@stack.nl> <20160509025107.GN89104@kib.kiev.ua> <20160513153716.GA30576@stack.nl> <20160513201916.GF89104@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160513201916.GF89104@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2016 22:34:38 -0000 On Fri, May 13, 2016 at 11:19:16PM +0300, Konstantin Belousov wrote: > On Fri, May 13, 2016 at 05:37:16PM +0200, Jilles Tjoelker wrote: > > On Mon, May 09, 2016 at 05:51:07AM +0300, Konstantin Belousov wrote: > > The mmap() page in POSIX.1-2008tc1 XSH 3 has: > > ] The state of synchronization objects such as mutexes, semaphores, > > ] barriers, and conditional variables placed in shared memory mapped > > ] with MAP_SHARED becomes undefined when the last region in any process > > ] containing the synchronization object is unmapped. > > This is new in issue 7 (SUSv4): > > ] Austin Group Interpretations 1003.1-2001 #078 and #079 are applied, > > ] clarifying page alignment requirements and adding a note about the > > ] state of synchronization objects becoming undefined when a shared > > ] region is unmapped. > Very interesting, thanks. > BTW, is there a chance of Austin Group get notified of, and possibly > adopting, MAP_EXCL flag ? You could send a message to the mailing list. MAP_EXCL is not used in the FreeBSD base but Debian code search shows Chromium and Hurd ftpfs mentioning it in comments. > > > Current updates to the patch > > > https://kib.kiev.ua/kib/pshared/robust.4.patch > Do you have any further notes, or do you want to give the patch more time ? > If not, are you fine with 'Reviewed by' attribution ? I don't trust the if (umtx_shm_vnobj_persistent) in sys/vm/vnode_pager.c: + if (umtx_shm_vnobj_persistent) + umtx_shm_object_terminated(obj); If umtx_shm_vnobj_persistent is turned off via sysctl between the check in sys/vm/vm_object.c and this one, don't we have a leak? 'Reviewed by: jilles' is fine otherwise. -- Jilles Tjoelker