Re: How should a driver shutdown a taskqueue on detach?

2015-08-04 Thread John Baldwin
On Wednesday, July 01, 2015 04:25:10 PM John-Mark Gurney wrote: Ryan Stone wrote this message on Wed, Jul 01, 2015 at 15:44 -0400: I'm trying to figure out how a driver is supposed to shut down its interrupt-handling taskqueue when it detaches. taskqueue(9) recommends disabling interrupts,

Re: How should a driver shutdown a taskqueue on detach?

2015-07-08 Thread Konstantin Belousov
On Tue, Jul 07, 2015 at 07:52:56PM -0400, Ryan Stone wrote: On Thu, Jul 2, 2015 at 3:08 AM, Konstantin Belousov kostik...@gmail.com wrote: Having taskqueue_enqueue() which could silently (?) not enqueue the given task is huge and IMO risky change to the KPI. If doing it, I think that

Re: How should a driver shutdown a taskqueue on detach?

2015-07-07 Thread Ryan Stone
On Thu, Jul 2, 2015 at 3:08 AM, Konstantin Belousov kostik...@gmail.com wrote: Having taskqueue_enqueue() which could silently (?) not enqueue the given task is huge and IMO risky change to the KPI. If doing it, I think that there should be a new function to enqueue, which is allowed to

Re: How should a driver shutdown a taskqueue on detach?

2015-07-02 Thread Konstantin Belousov
On Wed, Jul 01, 2015 at 06:28:49PM -0400, Ryan Stone wrote: On Wed, Jul 1, 2015 at 5:32 PM, Konstantin Belousov kostik...@gmail.com wrote: Do you mean, you want some KPI like boolean taskqueue_is_draining(struct taskqueue *p); so that e.g. executed task could see if it is

Re: How should a driver shutdown a taskqueue on detach?

2015-07-01 Thread Jack Vogel
But if you've disabled interrupts why would an interrupt-handling task even run?? Jack On Wed, Jul 1, 2015 at 12:44 PM, Ryan Stone ryst...@gmail.com wrote: I'm trying to figure out how a driver is supposed to shut down its interrupt-handling taskqueue when it detaches. taskqueue(9)

Re: How should a driver shutdown a taskqueue on detach?

2015-07-01 Thread Ryan Stone
On Wed, Jul 1, 2015 at 4:58 PM, Jack Vogel jfvo...@gmail.com wrote: But if you've disabled interrupts why would an interrupt-handling task even run?? Jack There's a race. The task could have already have been scheduled by a previous interrupt and could be running while I am trying to

Re: How should a driver shutdown a taskqueue on detach?

2015-07-01 Thread Konstantin Belousov
On Wed, Jul 01, 2015 at 05:09:27PM -0400, Ryan Stone wrote: On Wed, Jul 1, 2015 at 4:58 PM, Jack Vogel jfvo...@gmail.com wrote: But if you've disabled interrupts why would an interrupt-handling task even run?? Jack There's a race. The task could have already have been scheduled by

Re: How should a driver shutdown a taskqueue on detach?

2015-07-01 Thread Eric Joyner
Or like, taskqueue_enqueue_if_not_draining() ? :p On Wed, Jul 1, 2015 at 2:32 PM Konstantin Belousov kostik...@gmail.com wrote: On Wed, Jul 01, 2015 at 05:09:27PM -0400, Ryan Stone wrote: On Wed, Jul 1, 2015 at 4:58 PM, Jack Vogel jfvo...@gmail.com wrote: But if you've disabled

Re: How should a driver shutdown a taskqueue on detach?

2015-07-01 Thread Ryan Stone
On Wed, Jul 1, 2015 at 5:32 PM, Konstantin Belousov kostik...@gmail.com wrote: Do you mean, you want some KPI like boolean taskqueue_is_draining(struct taskqueue *p); so that e.g. executed task could see if it is executing in the shutdown state ? I'd prefer a KPI that stops a

Re: How should a driver shutdown a taskqueue on detach?

2015-07-01 Thread Jack Vogel
Ya, that seems elegant. Jack On Wed, Jul 1, 2015 at 3:28 PM, Ryan Stone ryst...@gmail.com wrote: On Wed, Jul 1, 2015 at 5:32 PM, Konstantin Belousov kostik...@gmail.com wrote: Do you mean, you want some KPI like boolean taskqueue_is_draining(struct taskqueue *p); so that e.g.

Re: How should a driver shutdown a taskqueue on detach?

2015-07-01 Thread John-Mark Gurney
Ryan Stone wrote this message on Wed, Jul 01, 2015 at 15:44 -0400: I'm trying to figure out how a driver is supposed to shut down its interrupt-handling taskqueue when it detaches. taskqueue(9) recommends disabling interrupts, draining each task and then freeing the taskqueue. The problem