[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160819.180953.970774471141286228.davem@davemloft.net>
Date: Fri, 19 Aug 2016 18:09:53 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: cascardo@...hat.com, dev@...nvswitch.org, netdev@...r.kernel.org
Subject: Re: [RFC PATCH] openvswitch: use percpu flow stats
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Fri, 19 Aug 2016 12:56:56 -0700
> On Fri, 2016-08-19 at 16:47 -0300, Thadeu Lima de Souza Cascardo wrote:
>> Instead of using flow stats per NUMA node, use it per CPU. When using
>> megaflows, the stats lock can be a bottleneck in scalability.
>
> ...
>
>>
>> flow_cache = kmem_cache_create("sw_flow", sizeof(struct sw_flow)
>> - + (nr_node_ids
>> + + (num_possible_cpus()
>> * sizeof(struct flow_stats *)),
>> 0, 0, NULL);
>> if (flow_cache == NULL)
>
> This is bogus.
>
> Please use nr_cpu_ids instead of num_possible_cpus().
Then how would hot-plugged cpus be handled properly?
The only other way is you'd have to free all objects in the current
flow_cache, destroy it, then make a new kmem_cache and reallocate
all of the existing objects and hook them back up every time a cpu
up event occurs.
That doesn't make any sense at all.
Therefore, the size of the objects coming out of "sw_flow" have
to accomodate all possible cpu indexes.
Powered by blists - more mailing lists