netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Dirk Hohndel <dirk@hohndel.org>,
	netdev@vger.kernel.org, David Woodhouse <dwmw2@infradead.org>
Subject: Re: surprising memory request
Date: Mon, 21 Jan 2013 13:21:49 +0800	[thread overview]
Message-ID: <50FCD06D.9060000@redhat.com> (raw)
In-Reply-To: <1358531673.11051.420.camel@edumazet-glaptop>

On 01/19/2013 01:54 AM, Eric Dumazet wrote:
> On Fri, 2013-01-18 at 09:46 -0800, Eric Dumazet wrote:
>
>> Thats because Jason thought that tun device had to have an insane number
>> of queues to get good performance.
>>
>> #define MAX_TAP_QUEUES 1024
>>
>> Thats crazy if your machine has say 8 cpus.
>>
>> And Jason didnt care to adapt the memory allocations done in
>> alloc_netdev_mqs(), in order to switch to vmalloc() when kmalloc()
>> fails.
> I suggest using the more reasonable :
>
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index c81680d..ec18fbf 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -113,7 +113,7 @@ struct tap_filter {
>   * the order of 100-200 CPUs so this leaves us some breathing space if we want
>   * to match a queue per guest CPU.
>   */
> -#define MAX_TAP_QUEUES 1024
> +#define MAX_TAP_QUEUES DEFAULT_MAX_NUM_RSS_QUEUES
>  
>  #define TUN_FLOW_EXPIRE (3 * HZ)
>  

But it's default value 8 is a little too small, we can easily have a kvm
guest with more than 8 vcpus and a host multiqueue card with more than 8
queues. Maybe we can use num_possible_cpus() or just an arbitrary number
such as 256 which seems large enough.


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

  reply	other threads:[~2013-01-21  5:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-18 16:58 surprising memory request Dirk Hohndel
2013-01-18 17:46 ` Eric Dumazet
2013-01-18 17:52   ` Stephen Hemminger
2013-01-21  5:44     ` Jason Wang
2013-01-18 17:54   ` Eric Dumazet
2013-01-21  5:21     ` Jason Wang [this message]
2013-01-18 17:59   ` David Woodhouse
2013-01-20 13:06     ` Ben Hutchings
2013-01-21  5:23     ` Jason Wang
2013-01-21  5:13   ` Jason Wang
2013-01-18 18:09 ` Waskiewicz Jr, Peter P
2013-01-18 18:11   ` Waskiewicz Jr, Peter P

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=50FCD06D.9060000@redhat.com \
    --to=jasowang@redhat.com \
    --cc=dirk@hohndel.org \
    --cc=dwmw2@infradead.org \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).