Am Samstag, 16. April 2005 04:47 schrieb Alan Stern:
> On Sat, 16 Apr 2005, Oliver Neukum wrote:
>
> > > The point is not whether things are interrupt-driven, it's whether or not
> > > interrupts are enabled. �In a bottom-half handler all the time-consuming
> > > work can be done with interrupts enabled.
> >
> > How so? Part of the work done in IRQ can be shifted to tasklets, yes.
>
> So can part of the work done in enqueue.
>
> > But the enqueue times are worse, so are in more need of optimisation.
>
> Although enqueue took more time than IRQ handling on average, I'm more
> concerned about maximum times. Enqueue's maximum time was worse on one of
> the computers, IRQ handling's was worse on the other.
But enqueuing in many drivers is part of irq handling. Storage is an
exception in that regard.
> In any case, I'm not concerned about optimization -- if I was I wouldn't
> be talking about using a bottom half. I'm concerned about reducing the
> amount of time spent with interrupts disabled. It's not necessary to
> optimize any code or improve any run times; it's necessary only to move
> things around so they can execute with interrupts enabled.
>
> > So instead of shifting code in the enqueue path to a different lock,
> > shifting it under no lock or into another path at all would seem better
> > to me.
>
> Who said anything about a different lock? The tasklet approach will shift
> enqueue code to run in the tasklet, which means it automatically benefits
> from the kernel's policy of allowing only one instance of a tasklet to run
> at any time. Anyway, locks aren't the issue -- interrupt enabling is.
What is the point of using a tasklet? It is about locking, not context.
Using a tasklet from task context is never sensible. Either you need
interrupts off, or you don't need them off. Needing to take a spinlock
in a tasklet doesn't help. Task context is already lower in priority.
In addition, usb_submit_urb() must work from hard irq context.
You need to to do anything than can error before you kick off a
tasklet, and you must make sure that usb_unlink_urb() will work
before the tasklet runs.
Regards
Oliver
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel