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

next in thread | previous in thread | raw e-mail | index | archive | help
Hans,
Thanks for the info.
> No sleeping functions like taskqueue_drain() can be called when the MTX_D=
EF lock is grabbed.
I am guessing this is true irrespective of whether the taskqueue is "fast" =
or not.
Thanks
David S.

-----Original Message-----
From: Hans Petter Selasky [mailto:hps@selasky.org]=20
Sent: Tuesday, April 18, 2017 9:22 PM
To: Sepherosa Ziehau <sepherosa@gmail.com>; Somayajulu, David <David.Somaya=
julu@cavium.com>
Cc: freebsd-net@freebsd.org
Subject: Re: Question on taskqueue_drain

On 04/19/17 05:37, Sepherosa Ziehau wrote:
> On Wed, Apr 19, 2017 at 10:39 AM, Somayajulu, David=20
> <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=20
> best case.  If the lock will be acquired in the task being drained,=20
> 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?BY2PR07MB1474DA5E249A0FE4CEFDA0A7EE180>