[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netfilter-devel
Subject:    Re: [PATCH v3 nf-next] netfilter: nft_set_rbtree: use seqcount to avoid lock in most cases
From:       Pablo Neira Ayuso <pablo () netfilter ! org>
Date:       2017-07-31 17:50:51
Message-ID: 20170731175051.GA6442 () salvia
[Download RAW message or body]

On Fri, Jul 28, 2017 at 10:34:42AM +0200, Florian Westphal wrote:
> switch to lockless lockup. write side now also increments sequence
> counter.  On lookup, sample counter value and only take the lock
> if we did not find a match and the counter has changed.
> 
> This avoids need to write to private area in normal (lookup) cases.
> 
> In case we detect a writer (seqretry is true) we fall back to taking
> the readlock.
> 
> The readlock is also used during dumps to ensure we get a consistent
> tree walk.
> 
> Similar technique (rbtree+seqlock) was used by David Howells in rxrpc.

Applied, thanks.

I think this is still going to be slower than any native rcu-friendly
tree implementation, so I still see value for the bonsai tree idea.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic