From owner-freebsd-hackers@freebsd.org Mon Nov 21 15:26:10 2016 Return-Path: Delivered-To: freebsd-hackers@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 54F78C4D83B for ; Mon, 21 Nov 2016 15:26:10 +0000 (UTC) (envelope-from Volker.Lendecke@SerNet.DE) Received: from mail.SerNet.de (mail.SerNet.de [193.175.80.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20B1419C5 for ; Mon, 21 Nov 2016 15:26:09 +0000 (UTC) (envelope-from Volker.Lendecke@SerNet.DE) Received: from intern.SerNet.DE by mail.SerNet.DE with esmtps (Exim 4.84_2 #1) id 1c8qTu-00019X-Ij; Mon, 21 Nov 2016 16:26:06 +0100 Received: by intern.sernet.de id 1c8qTu-0005Qp-Fz; Mon, 21 Nov 2016 16:26:06 +0100 Date: Mon, 21 Nov 2016 16:25:42 +0100 From: Volker Lendecke To: Konstantin Belousov Cc: freebsd-hackers@freebsd.org Subject: Re: process shared mutexes? Message-ID: <20161121152542.GA31733@sernet.de> Reply-To: Volker.Lendecke@SerNet.DE References: <20161121133528.GA30947@sernet.de> <20161121135036.GY54029@kib.kiev.ua> <20161121141616.GB30947@sernet.de> <20161121151040.GA54029@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161121151040.GA54029@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2016 15:26:10 -0000 On Mon, Nov 21, 2016 at 05:10:40PM +0200, Konstantin Belousov wrote: > Please see the libthr(3) man page, in particular, read the RUN-TIME > SETTINGS section, the description of the kern.ipc.umtx_vnode_persistent > sysctl. > > Does setting the sysctl to 1 allow your program to run ? Yes, that does make it work. The description says that the umtx vnode is dropped on the last munmap. If I #if 0 the middle mmap, it works, although there is no mmap around anymore. So the description is not 100% accurate I'd say. When does the recycling happen exactly? Can it break running applications? And -- how can I make sure for Samba that this is set properly at runtime? We already have a runtime mutex test for some ancient Linux kernels that were broken. We could add this as a subtest too. But -- what happens if the admin resets this while Samba is running? Does the kernel make sure that existing files still get the correct behaviour when the sysctl changes? Thanks! Volker