Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Apr 2017 06:22:28 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        Sepherosa Ziehau <sepherosa@gmail.com>, "Somayajulu, David" <David.Somayajulu@cavium.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: Question on taskqueue_drain
Message-ID:  <1fb80f2b-9086-0260-2f63-bdaf8afc1c4c@selasky.org>
In-Reply-To: <CAMOc5cxtSakeBhskbmfW4BxsbgdRDp22AVBYrDgReCP91YLY7g@mail.gmail.com>
References:  <BY2PR07MB14745123AC235B06BCD2987DEE190@BY2PR07MB1474.namprd07.prod.outlook.com> <BY2PR07MB1474C78A241A7CA1F2396435EE180@BY2PR07MB1474.namprd07.prod.outlook.com> <CAMOc5cxtSakeBhskbmfW4BxsbgdRDp22AVBYrDgReCP91YLY7g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 04/19/17 05:37, Sepherosa Ziehau wrote:
> On Wed, Apr 19, 2017 at 10:39 AM, Somayajulu, David
> <David.Somayajulu@cavium.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1fb80f2b-9086-0260-2f63-bdaf8afc1c4c>