From owner-svn-src-all@FreeBSD.ORG Fri May 22 06:46:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26754FE9; Fri, 22 May 2015 06:46:26 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DADD1465; Fri, 22 May 2015 06:46:26 +0000 (UTC) Received: from Xins-MBP.home.us.delphij.net (unknown [IPv6:2601:9:7280:1a80:a8a0:d4d4:c68d:5e24]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id B115E1411F; Thu, 21 May 2015 23:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1432277185; x=1432291585; bh=fngUBeiD7m2pGdhOou6kcgTbTfj/ICConZHt6NufKfA=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=duMzHzfGjsFrbJ6cL+h/HhDwrKMx2rianu8SZDm4E24DScksUZbcBispAn/57JMys 5m+kwxLfg6xMNCmHN0VowJlkBCtlmQLtu6q6jgD3bkjk31gIVnB7oZZuemztuPDuTc tRzFPesZUl8NfnzyTtnbH/gnw3psC5qDeiEGbeJE= Message-ID: <555ED0BE.2080602@delphij.net> Date: Thu, 21 May 2015 23:46:22 -0700 From: Xin Li User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Mateusz Guzik , John Baldwin CC: Alexander Kabaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282971 - in head/sys: kern sys References: <201505151350.t4FDocQT054144@svn.freebsd.org> <20150520120046.268dde86@kan> <2114957.Lbz1KNQfZU@ralph.baldwin.cx> <20150521165826.GA17403@dft-labs.eu> In-Reply-To: <20150521165826.GA17403@dft-labs.eu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2015 06:46:26 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 5/21/15 09:58, Mateusz Guzik wrote: > In other words, I would argue modifying native privmitives to > accomodate for zfs use may not be the best course of action. Well, POSIX says this about pthread_cond_destroy(), quote: "A condition variable can be destroyed immediately after all the threads that are blocked on it are awakened." This is also supported by our userland thread library (libthr), by the way, and I don't see this as an unreasonable expectation, as there is no programmer accessible API to drain a conditional variable. BTW. what ZFS code does is that it released the mutex (z_range_lock in the zfs_rlock.c case), then did a broadcast, at which point the code shall reasonably expect that all threads that are blocked on it are awaken, and destroying the condition variable *must* be safe at the time . Cheers, -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJVXtC8AAoJEJW2GBstM+nsvBwP/3lx99PDC+LDYXnZ4wE3bOxh h7I/Sn7fSMO8UzsY6H9Wgaw9SvPzLbeCtAuild8prcmtkIBfX2AJ2Z3MhrmaZjR3 zaZJhOL3gHOip9YWy6nSUaKeFjKgpoA4VrvyOhVczBZ45FYElEseYbnnr+QYA4AZ U9PsSDf23z72/iCebbxwCNZt07sAPj3UtmWQAP0iGPIlUkW8kyJMzHn9jwLfENnH GgBb8C9o9ayBODNh/JfeMnyFylRLnK2GllP5p4zi2boKprKBrFgEVUVo72bhXjD0 zhk3+shXi3U99SuudR7+tRSHHJNeaAOnfPOyNF3EvRFPsIsU/sxZL+FHy4AePURp 7qFJeozEX4mphj5m4WOlX8NMZoEm3SwInVjmlnb0yaOVuLtFM+IUkguYHO2Ckb4X byljvYGXHXKoFZQx4LN+YOdTAOF2xvNhmwB9scfBYI+tEAzIoakcPE1eeciLHmR5 jjLjW4MX8fgMtvBlVlh9XOre9J81Cgj5mxmBK3Z4KnuZD26yrjpn4ZauCI6/7vRN c16mgsdC5lzmgheWhDAethg5oXO0r5xmapLOMMW3ZE4LZ7+L6bCvMsmAjcmVwOzQ ftyO20wx5JTicaK0oPz9i31Szdm8c4z6B/GZdHbZJT+tdypo2WcO9/OLeqDjo3Jj 6prgPNxd72hHS4okdTSA =KCdi -----END PGP SIGNATURE-----