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

2013-12-18 Thread David Laight
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. Signed-off-by: David Laight --- v2: Added signed-off-by line drive

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

2013-12-19 Thread Sarah Sharp
On Wed, Dec 18, 2013 at 11:24:47AM -, 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 pag

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

2013-12-19 Thread Steve Calfee
On Wed, Dec 18, 2013 at 3:24 AM, 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. > >

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

2013-12-19 Thread David Cohen
On Wed, Dec 18, 2013 at 11:24:47AM -, 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 pag

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

2013-12-20 Thread David Laight
> From: Steve Calfee > On Wed, Dec 18, 2013 at 3:24 AM, 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

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

2013-12-20 Thread David Laight
> From: David Cohen > On Wed, Dec 18, 2013 at 11:24:47AM -, 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)

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

2013-12-20 Thread David Cohen
On Fri, Dec 20, 2013 at 09:26:35AM -, David Laight wrote: > > From: David Cohen > > On Wed, Dec 18, 2013 at 11:24:47AM -, David Laight wrote: > > > This saves a kzalloc() call on every transfer and some memory > > > indirections. > > > > > > The only possible downside is for isochronous tra

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

2014-01-06 Thread David Laight
> From: David Cohen > On Fri, Dec 20, 2013 at 09:26:35AM -, David Laight wrote: > > > From: David Cohen > > 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 th

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

2014-01-06 Thread 'David Cohen'
On Mon, Jan 06, 2014 at 09:26:20AM +, David Laight wrote: > > From: David Cohen > > On Fri, Dec 20, 2013 at 09:26:35AM -, David Laight wrote: > > > > From: David Cohen > > > The effect of this change is really to remove the first allocation and > > > add 8 bytes (or maybe a pointer) to the

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

2014-01-07 Thread David Laight
> From: 'David Cohen' > On Mon, Jan 06, 2014 at 09:26:20AM +, David Laight wrote: > > > From: David Cohen > > > On Fri, Dec 20, 2013 at 09:26:35AM -, David Laight wrote: > > > > > From: David Cohen > > > > The effect of this change is really to remove the first allocation and > > > > add 8

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

2014-01-07 Thread 'David Cohen'
On Tue, Jan 07, 2014 at 09:29:30AM +, David Laight wrote: > > From: 'David Cohen' > > On Mon, Jan 06, 2014 at 09:26:20AM +, David Laight wrote: > > > > From: David Cohen > > > > On Fri, Dec 20, 2013 at 09:26:35AM -, David Laight wrote: > > > > > > From: David Cohen > > > > > The effect

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

2014-01-08 Thread David Laight
> From: 'David Cohen' ... > > > The new kmalloc is going to be "n * sizeof(struct) - n * sizeof(pointer)" > > > bigger. I don't know what is the usual range of values for "n", but my > > > experience with android devices with non-abundant memory size is that > > > they are sensible to kmalloc > PAG

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

2014-01-08 Thread 'David Cohen'
On Wed, Jan 08, 2014 at 09:25:42AM +, David Laight wrote: > > From: 'David Cohen' > ... > > > > The new kmalloc is going to be "n * sizeof(struct) - n * > > > > sizeof(pointer)" > > > > bigger. I don't know what is the usual range of values for "n", but my > > > > experience with android devic

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

2014-01-08 Thread David Laight
> From: 'David Cohen' ... > I actually don't know what's the regular range of 'td_cnt'. But what got my > attention was this comment from patch description: > > "The only possible downside is for isochronous tranfers with 64 td > when the allocate is 8+4096 bytes (on 64bit systems) so requires > a

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

2014-01-08 Thread 'David Cohen'
On Wed, Jan 08, 2014 at 03:29:31PM +, David Laight wrote: > > From: 'David Cohen' > ... > > I actually don't know what's the regular range of 'td_cnt'. But what got my > > attention was this comment from patch description: > > > > "The only possible downside is for isochronous tranfers with 64

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

2014-01-22 Thread David Laight
From: Sarah> Sharp > On Wed, Dec 18, 2013 at 11:24:47AM -, David Laight wrote: > > This saves a kzalloc() call on every transfer and some memory > > indirections. > > ... > Hi David, > > The patch looks good in general and applies fine. However, in testing > this with a USB mass storage devic