RE: [PATCH v2] xhci: Allocate the td array and urb_priv together.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: David Cohen
> On Wed, Dec 18, 2013 at 11:24:47AM -0000, David Laight wrote:
> > This saves a kzalloc() call on every transfer and some memory
> > indirections.
> >
> > The only possible downside is for isochronous tranfers with 64 td
> > when the allocate is 8+4096 bytes (on 64bit systems) so requires
> > an additional page.
> 
> If you take this to embedded world there could be a bad side effect too.
> The free memory isn't abundant and the fragmentation may make a bigger
> kmalloc() to cost more than 2 smaller ones.

The effect of this change is really to remove the first allocation and
add 8 bytes (or maybe a pointer) to the start of the second one.
So it is extremely unlikely to fail when the old code would work.

It would, of course, be better to allocate a parallel 'software' ring
containing the required extra information and completely remove the
additional allocate/free on every USB request.

	David



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux