From owner-freebsd-net@freebsd.org Wed Apr 19 04:24:27 2017 Return-Path: Delivered-To: freebsd-net@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 8522BD45361 for ; Wed, 19 Apr 2017 04:24:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EA91FC for ; Wed, 19 Apr 2017 04:24:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id BBE001FE022; Wed, 19 Apr 2017 06:24:17 +0200 (CEST) Subject: Re: Question on taskqueue_drain To: Sepherosa Ziehau , "Somayajulu, David" References: Cc: "freebsd-net@freebsd.org" From: Hans Petter Selasky Message-ID: <1fb80f2b-9086-0260-2f63-bdaf8afc1c4c@selasky.org> Date: Wed, 19 Apr 2017 06:22:28 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Apr 2017 04:24:27 -0000 On 04/19/17 05:37, Sepherosa Ziehau wrote: > On Wed, Apr 19, 2017 at 10:39 AM, Somayajulu, David > wrote: >> Sorry what I meant to ask was, whether it is O.K to call taskqueue_drain(), when an MTX_DEF lock is grabbed prior to calling taskqueue_drain(). >> > > You will hit WITNESS, if the drain needs to wait; that's probably the > best case. If the lock will be acquired in the task being drained, > this leads to deadlock. > Hi, No sleeping functions like taskqueue_drain() can be called when the MTX_DEF lock is grabbed. --HPS