public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: mst@redhat.com, penberg@kernel.org, will.deacon@arm.com,
	marc.zyngier@arm.com, kvm@vger.kernel.org, asias@redhat.com,
	jasowang@redhat.com
Subject: Re: [PATCH] virtio-net: fill only rx queues which are being used
Date: Tue, 23 Apr 2013 00:49:23 -0400	[thread overview]
Message-ID: <517612D3.6090909@oracle.com> (raw)
In-Reply-To: <87obd5ga0f.fsf@rustcorp.com.au>

On 04/23/2013 12:13 AM, Rusty Russell wrote:
> Sasha Levin <sasha.levin@oracle.com> writes:
>> Due to MQ support we may allocate a whole bunch of rx queues but
>> never use them. With this patch we'll safe the space used by
>> the receive buffers until they are actually in use:
> 
> Idea is good, implementation needs a tiny tweak:
> 
>> @@ -912,8 +913,13 @@ static int virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs)
>>  		dev_warn(&dev->dev, "Fail to set num of queue pairs to %d\n",
>>  			 queue_pairs);
>>  		return -EINVAL;
>> -	} else
>> +	} else {
>> +		if (queue_pairs > vi->curr_queue_pairs)
>> +			for (i = 0; i < queue_pairs; i++)
>> +				if (!try_fill_recv(&vi->rq[i], GFP_KERNEL))
>> +					schedule_delayed_work(&vi->refill, 0);
>>  		vi->curr_queue_pairs = queue_pairs;
>> +	}
>>  
>>  	return 0;
>>  }
> 
> You don't want to refill existing queues, so you don't need the "if".
> 
>         for (i = vi->curr_queue_pairs; i < queue_pairs; i++) {
> 		if (!try_fill_recv(&vi->rq[i], GFP_KERNEL))
> 			schedule_delayed_work(&vi->refill, 0);

That makes more sense, I'll resend.

> We don't free up buffers when we're reducing queues, but I consider that
> a corner case.

It didn't bother anyone up until now, and the spec doesn't state anything
about it - so I preferred to just leave that alone. Unless the ARM folks
would find it useful?


Thanks,
Sasha

  reply	other threads:[~2013-04-23  4:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23  0:35 [PATCH] virtio-net: fill only rx queues which are being used Sasha Levin
2013-04-23  4:13 ` Rusty Russell
2013-04-23  4:49   ` Sasha Levin [this message]
2013-04-23  9:18     ` Will Deacon
2013-04-23  7:08 ` Michael S. Tsirkin
2013-04-23 14:52   ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=517612D3.6090909@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=asias@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mst@redhat.com \
    --cc=penberg@kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox