Re: [PATCH v3 2/2] virtio-ring: Allocate indirect buffers from cache when possible

2012-09-05 Thread Avi Kivity
On 09/04/2012 09:41 PM, Michael S. Tsirkin wrote: On Tue, Sep 04, 2012 at 07:34:19PM +0300, Avi Kivity wrote: On 08/31/2012 12:56 PM, Michael S. Tsirkin wrote: On Fri, Aug 31, 2012 at 11:36:07AM +0200, Sasha Levin wrote: On 08/30/2012 03:38 PM, Michael S. Tsirkin wrote: +static unsigned

Re: [PATCH v3 2/2] virtio-ring: Allocate indirect buffers from cache when possible

2012-09-05 Thread Michael S. Tsirkin
On Wed, Sep 05, 2012 at 05:21:12PM +0300, Avi Kivity wrote: On 09/04/2012 09:41 PM, Michael S. Tsirkin wrote: On Tue, Sep 04, 2012 at 07:34:19PM +0300, Avi Kivity wrote: On 08/31/2012 12:56 PM, Michael S. Tsirkin wrote: On Fri, Aug 31, 2012 at 11:36:07AM +0200, Sasha Levin wrote: On

Re: [PATCH v3 2/2] virtio-ring: Allocate indirect buffers from cache when possible

2012-09-04 Thread Avi Kivity
On 08/31/2012 12:56 PM, Michael S. Tsirkin wrote: On Fri, Aug 31, 2012 at 11:36:07AM +0200, Sasha Levin wrote: On 08/30/2012 03:38 PM, Michael S. Tsirkin wrote: +static unsigned int indirect_alloc_thresh = 16; Why 16? Please make is MAX_SG + 1 this makes some sense. Wouldn't MAX_SG mean

Re: [PATCH v3 2/2] virtio-ring: Allocate indirect buffers from cache when possible

2012-09-04 Thread Avi Kivity
On 09/04/2012 07:34 PM, Avi Kivity wrote: On 08/31/2012 12:56 PM, Michael S. Tsirkin wrote: On Fri, Aug 31, 2012 at 11:36:07AM +0200, Sasha Levin wrote: On 08/30/2012 03:38 PM, Michael S. Tsirkin wrote: +static unsigned int indirect_alloc_thresh = 16; Why 16? Please make is MAX_SG + 1 this

Re: [PATCH v3 2/2] virtio-ring: Allocate indirect buffers from cache when possible

2012-09-04 Thread Michael S. Tsirkin
On Tue, Sep 04, 2012 at 07:34:19PM +0300, Avi Kivity wrote: On 08/31/2012 12:56 PM, Michael S. Tsirkin wrote: On Fri, Aug 31, 2012 at 11:36:07AM +0200, Sasha Levin wrote: On 08/30/2012 03:38 PM, Michael S. Tsirkin wrote: +static unsigned int indirect_alloc_thresh = 16; Why 16? Please

Re: [PATCH v3 2/2] virtio-ring: Allocate indirect buffers from cache when possible

2012-08-31 Thread Sasha Levin
On 08/30/2012 03:38 PM, Michael S. Tsirkin wrote: +static unsigned int indirect_alloc_thresh = 16; Why 16? Please make is MAX_SG + 1 this makes some sense. Wouldn't MAX_SG mean we always allocate from the cache? Isn't the memory waste too big in this case? -- To unsubscribe from this list:

Re: [PATCH v3 2/2] virtio-ring: Allocate indirect buffers from cache when possible

2012-08-31 Thread Michael S. Tsirkin
On Fri, Aug 31, 2012 at 11:36:07AM +0200, Sasha Levin wrote: On 08/30/2012 03:38 PM, Michael S. Tsirkin wrote: +static unsigned int indirect_alloc_thresh = 16; Why 16? Please make is MAX_SG + 1 this makes some sense. Wouldn't MAX_SG mean we always allocate from the cache? Isn't the memory

[PATCH v3 2/2] virtio-ring: Allocate indirect buffers from cache when possible

2012-08-30 Thread Sasha Levin
Currently if VIRTIO_RING_F_INDIRECT_DESC is enabled we will use indirect descriptors and allocate them using a simple kmalloc(). This patch adds a cache which will allow indirect buffers under a configurable size to be allocated from that cache instead. Signed-off-by: Sasha Levin

Re: [PATCH v3 2/2] virtio-ring: Allocate indirect buffers from cache when possible

2012-08-30 Thread Michael S. Tsirkin
On Thu, Aug 30, 2012 at 01:21:58PM +0200, Sasha Levin wrote: Currently if VIRTIO_RING_F_INDIRECT_DESC is enabled we will use indirect descriptors and allocate them using a simple kmalloc(). This patch adds a cache which will allow indirect buffers under a configurable size to be allocated