Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1308721

Re: [PATCH] netfilter: nf_conntrack: use safer way to lock all buckets

From Sasha Levin <sasha.levin@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH] netfilter: nf_conntrack: use safer way to lock all buckets
Date 2016-01-13 19:40 +0100
Message-ID <qQyuS-3Ce-19@gated-at.bofh.it> (permalink)
References <qNpxL-3Lr-7@gated-at.bofh.it> <qPcG5-5m2-1@gated-at.bofh.it> <qQwW6-2vW-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 01/13/2016 11:54 AM, Pablo Neira Ayuso wrote:
> On Sun, Jan 10, 2016 at 02:06:37AM +0100, Florian Westphal wrote:
>> > Sasha Levin <sasha.levin@oracle.com> wrote:
>>> > > Fix this by using a global lock and synchronize all buckets on it when we
>>> > > need to lock them all. This is pretty heavyweight, but is only done when we
>>> > > need to resize the hashtable, and that doesn't happen often enough (or at all).
>> > 
>>> > > diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
>>> > > index 3cb3cb8..3c008ce 100644
>>> > > --- a/net/netfilter/nf_conntrack_core.c
>>> > > +++ b/net/netfilter/nf_conntrack_core.c
>>> > > @@ -66,6 +66,32 @@ EXPORT_SYMBOL_GPL(nf_conntrack_locks);
>>> > >  __cacheline_aligned_in_smp DEFINE_SPINLOCK(nf_conntrack_expect_lock);
>>> > >  EXPORT_SYMBOL_GPL(nf_conntrack_expect_lock);
>>> > >  
>>> > > +spinlock_t nf_conntrack_locks_all_lock;
>>> > > +bool nf_conntrack_locks_all;
>> > 
>> > Seems both of these can be static and __read_mostly too --
>> > as you already note resizing virtually never happens.
>> >
>> > Otherwise:
>> > Reviewed-by: Florian Westphal <fw@strlen.de>
> Sasha, would you resubmit addressing Florian's feedback?

Yup, sorry - still catching up with the holidays vacation :(


Thanks,
Sasha

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] netfilter: nf_conntrack: use safer way to lock all buckets Sasha Levin <sasha.levin@oracle.com> - 2016-01-05 03:30 +0100
  RE: [PATCH] netfilter: nf_conntrack: use safer way to lock all  buckets David Laight <David.Laight@ACULAB.COM> - 2016-01-05 12:20 +0100
  Re: [PATCH] netfilter: nf_conntrack: use safer way to lock all  buckets Florian Westphal <fw@strlen.de> - 2016-01-10 02:10 +0100
    Re: [PATCH] netfilter: nf_conntrack: use safer way to lock all  buckets Pablo Neira Ayuso <pablo@netfilter.org> - 2016-01-13 18:00 +0100
      Re: [PATCH] netfilter: nf_conntrack: use safer way to lock all  buckets Sasha Levin <sasha.levin@oracle.com> - 2016-01-13 19:40 +0100
  Re: [PATCH] netfilter: nf_conntrack: use safer way to lock all  buckets Jesper Dangaard Brouer <brouer@redhat.com> - 2016-01-14 15:20 +0100

csiph-web