[ovs-dev] [PATCH net-next 3/3] nftables: Convert nft_hash to use generic rhashtable

Patrick McHardy kaber at trash.net
Fri Aug 1 10:47:28 UTC 2014


On 1. August 2014 11:39:01 GMT+01:00, Thomas Graf <tgraf at suug.ch> wrote:
>On 08/01/14 at 11:17am, Patrick McHardy wrote:
>> On 1. August 2014 09:52:00 GMT+01:00, Thomas Graf <tgraf at suug.ch>
>wrote:
>> >If the set size is known in advance, the table is sized accordingly,
>> >otherwise the table size will default to 64. This is a slight change
>> >in behaviour as previously the default was 4 which eventually
>required
>> >many expansion iterations.
>> 
>> That's assuming a sufficient number of entries will be added. I think
>there
>> will be many cases in nftables where the number will be lower. Since
>> expansion is not very expansive this number was chosen very
>deliberately
>> and I'd prefer to keep it.
>> 
>> Other than that:
>> 
>> Acked-by: Patrick McHardy <kaber at trash.net>
>
>OK, I will change the nft_hash default size back to 4.

Thanks.

>I think the expansion is more expensive than it looks though as we
>are potentially calling synchronize_rcu() multiple times while
>holding a mutex to protect from concurrent mutations.

True. On average it should only be a single grace period though IIRC.




More information about the dev mailing list