From owner-freebsd-arch@freebsd.org Sat May 14 10:10:50 2016 Return-Path: Delivered-To: freebsd-arch@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 881CEB3A893 for ; Sat, 14 May 2016 10:10:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 7152B1B7E for ; Sat, 14 May 2016 10:10:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 6C733B3A891; Sat, 14 May 2016 10:10:50 +0000 (UTC) Delivered-To: arch@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 6BDF0B3A88F; Sat, 14 May 2016 10:10:50 +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 E25271B7A; Sat, 14 May 2016 10:10:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u4EAAiVJ060181 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 14 May 2016 13:10:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4EAAiVJ060181 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4EAAiVg060178; Sat, 14 May 2016 13:10:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 14 May 2016 13:10:44 +0300 From: Konstantin Belousov To: Jilles Tjoelker Cc: threads@freebsd.org, arch@freebsd.org Subject: Re: Robust mutexes implementation Message-ID: <20160514101044.GM89104@kib.kiev.ua> 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> <20160513223434.GA47987@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160513223434.GA47987@stack.nl> User-Agent: Mutt/1.6.1 (2016-04-27) 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-arch@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2016 10:10:50 -0000 On Sat, May 14, 2016 at 12:34:34AM +0200, Jilles Tjoelker wrote: > On Fri, May 13, 2016 at 11:19:16PM +0300, Konstantin Belousov wrote: > > 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. It is not clear if they reference FreeBSD flag, or just come to this semi-obvious idea independently. Anway, it is not used because feature is not present anywhere (except us). I do not want to present this on ag list as a stranger with bad language. > 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? Removed the test in the vnode_destroy_vobject(), doing the umtx termination unconditionally on reclaim. > > 'Reviewed by: jilles' is fine otherwise. Updated patch is at https://www.kib.kiev.ua/kib/pshared/robust.5.patch P.S. I will document UMUTEX_ROBUST/UMUTEX_RB_* and UMTX_OP_ROBUST_LISTS after the feature is committed.