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

From
Michael S. Tsirkin <mst@redhat.com>
Date
2012-09-05 14:26:39
Also in
kvm, lkml
Reply to
Avi Kivity, 2012-09-05
On Wed, Sep 05, 2012 at 05:21:12PM +0300, Avi Kivity wrote:
On 09/04/2012 09:41 PM, Michael S. Tsirkin wrote:
quoted
On Tue, Sep 04, 2012 at 07:34:19PM +0300, Avi Kivity wrote:
quoted
On 08/31/2012 12:56 PM, Michael S. Tsirkin wrote:
quoted
On Fri, Aug 31, 2012 at 11:36:07AM +0200, Sasha Levin wrote:
quoted
On 08/30/2012 03:38 PM, Michael S. Tsirkin wrote:
quoted
quoted
+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?
Sorry. I really meant MAX_SKB_FRAGS + 1. MAX_SKB_FRAGS is 17 so gets us
threshold of 18. It is less than the size of an skb+shinfo itself so -
does it look too big to you? Also why do you think 16 is not too big but
18 is?  If there's a reason then I am fine with 16 too but then please
put it in code comment near where the value is set.

Yes this means virtio net always allocates from cache
but this is a good thing, isn't it? Gets us more consistent
performance.
kmalloc() also goes to a cache.  Is there a measurable difference?
Yes see 0/2 and followup discussion.
I don't see 0/2, looks like this was not threaded properly.  What was
the subject line?
My mistake, there is no 0/2, the resolts where in the followup thread
of the previous version:
	[PATCH v2 2/2] virtio-ring: Allocate indirect buffers from cache when possible

Sasha, could you please accompany the next version
with a cover letter 0/2) including performance results?
-- 
error compiling committee.c: too many arguments to function
Thread (11 messages) 11 messages, 3 authors, last reply 2012-09-05
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help