Re: urbs are REFERENCE COUNTED!!!

Greg KH <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Mon, Apr 02, 2007 at 12:06:45PM -0700, David Brownell wrote:
> 
> > > That can certainly work, and it has the advantages of simplicity.
> > > I wouldn't use that strategy in every driver of course, but I'd
> > > guess it's fine for the serial and usblp cases mentioned here.
> > 
> > Why would you not want it in every driver?
> 
> For starters, your pre-emptive claim that performance isn't a factor
> is erroneous.  PCs are resource-rich -- in CPU and memory -- but Linux
> isn't just x86, and even x86 hits resource limits.
> 
> The CPU costs for hitting the heap twice (free then allocate) vs. just
> reusing an URB will add up in low-MIPS systems.  When those costs get
> paid in IRQ context, they impact IRQ latency.  When they get paid on
> systems with small batteries, they reduce time-till-recharge.  When
> they replace cache lines with less useful information, they increase
> the system's cycle-per-instruction ratio.  While the cost to one driver
> may not be high, system-wide costs do add up.

Ok, then a urb pool might be more applicable for systems like that, but
even then, we can't test for the status flag.

But I still think, given the advancement of processor speed over time,
trading simplicity in the driver by using fire-and-forget will work
well.  But benchmarks would be the best way to test this...

> > As Oliver is finding out, a 
> > lot of these "simple" drivers have races all due to their use of a
> > pre-allocated urb.  For what kind of situation would you feel this would
> > not work?
> 
> Not-simple drivers.  ;)

Then we should make them simpler :)

> Engineering tradeoffs always need to be made.  My point was less about
> "not work" and more about "good tradeoff".  One size does not fit all.
> A driver which prioritizes simplicity isn't necessarily going to handle
> all the corner cases robustly and efficiently.  Resource shortages are
> a *HUGE* category of corner cases.

Agreed.

thanks,

greg k-h

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.