LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCHv6 net-next 07/14] ipvs: add resizable hash tables

To: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Subject: Re: [PATCHv6 net-next 07/14] ipvs: add resizable hash tables
Cc: Simon Horman <horms@xxxxxxxxxxxx>, lvs-devel@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, Dust Li <dust.li@xxxxxxxxxxxxxxxxx>, Jiejian Wu <jiejian@xxxxxxxxxxxxxxxxx>, rcu@xxxxxxxxxxxxxxx
From: Julian Anastasov <ja@xxxxxx>
Date: Wed, 26 Nov 2025 22:02:37 +0200 (EET)
        Hello,

On Mon, 24 Nov 2025, Pablo Neira Ayuso wrote:

> On Sun, Oct 19, 2025 at 06:57:04PM +0300, Julian Anastasov wrote:
> > Add infrastructure for resizable hash tables based on hlist_bl
> > which we will use in followup patches.
> > 
> > The tables allow RCU lookups during resizing, bucket modifications
> > are protected with per-bucket bit lock and additional custom locking,
> > the tables are resized when load reaches thresholds determined based
> > on load factor parameter.
> 
> I understand the generic rhashtable implementation cannot be used in
> this case, but I am missing the reason why (comparison?).

        The main differences are:

- our hash keys are not on contiguous memory, need to fit
properly in cachelines
- we avoid IRQ locks: local_irq_save/local_irq_restore
- we will use double hashing for NAT
- we allow entries with duplicate keys, for performance reasons
- we do not lookup the entry that is to be removed, we know its
table and bucket id and unlink it with hlist_bl_del_rcu
- we prefer to customize the grow/shrink process

Regards

--
Julian Anastasov <ja@xxxxxx>



<Prev in Thread] Current Thread [Next in Thread>