netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>, Thomas Graf <tgraf@suug.ch>,
	David Laight <David.Laight@ACULAB.COM>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
	"edumazet@google.com" <edumazet@google.com>,
	"john.r.fastabend@intel.com" <john.r.fastabend@intel.com>,
	"josh@joshtriplett.org" <josh@joshtriplett.org>,
	"netfilter-devel@vger.kernel.org"
	<netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH 7/9] rhashtable: Per bucket locks & deferred expansion/shrinking
Date: Mon, 19 Jan 2015 01:01:21 -0800	[thread overview]
Message-ID: <20150119090121.GG9719@linux.vnet.ibm.com> (raw)
In-Reply-To: <20150116204644.GA2232@salvia>

On Fri, Jan 16, 2015 at 09:46:44PM +0100, Pablo Neira Ayuso wrote:
> On Fri, Jan 16, 2015 at 07:35:57PM +0000, Patrick McHardy wrote:
> > On 16.01, Thomas Graf wrote:
> > > On 01/16/15 at 06:36pm, Patrick McHardy wrote:
> > > > On 16.01, Thomas Graf wrote:
> > > > > On 01/16/15 at 04:43pm, David Laight wrote:
> > > > > > The walker is unlikely to see items that get inserted early in the hash
> > > > > > table even without a resize.
> > > > > 
> > > > > I don't follow, you have to explain this statement.
> > > > > 
> > > > > Walkers which don't want to see duplicates or miss entries should
> > > > > just take the mutex.
> > > > 
> > > > Well, we do have a problem with interrupted dumps. As you know once
> > > > the netlink message buffer is full, we return to userspace and
> > > > continue dumping during the next read. Expanding obviously changes
> > > > the order since we rehash from bucket N to N and 2N, so this will
> > > > indeed cause duplicate (doesn't matter) and missed entries.
> > > 
> > > Right,but that's a Netlink dump issue and not specific to rhashtable.
> > 
> > Well, rhashtable (or generally resizing) will make it a lot worse.
> > Usually we at worst miss entries which were added during the dump,
> > which is made up by the notifications.
> > 
> > With resizing we might miss anything, its completely undeterministic.
> > 
> > > Putting the sequence number check in place should be sufficient
> > > for sets, right?
> > 
> > I don't see how. The problem is that the ordering of the hash changes
> > and it will skip different entries than those that have already been
> > dumped.
> 
> I think the generation counter should catch up this sort of problems.
> The resizing is triggered by a new/deletion element, which bumps it
> once the transaction is handled.

One unconventional way of handling this is to associate the scan with
a one-to-one resize operation.  This can be implemented to have the
effect of taking a snapshot of the table.

							Thanx, Paul


  parent reply	other threads:[~2015-01-19  9:02 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1418647641.git.tgraf@suug.ch>
2014-12-15 12:51 ` [PATCH 1/9] rhashtable: Do hashing inside of rhashtable_lookup_compare() Thomas Graf
2014-12-15 12:51 ` [PATCH 5/9] nft_hash: Remove rhashtable_remove_pprev() Thomas Graf
2014-12-15 12:51 ` [PATCH 7/9] rhashtable: Per bucket locks & deferred expansion/shrinking Thomas Graf
2015-01-16 15:34   ` Patrick McHardy
2015-01-16 15:58     ` Thomas Graf
2015-01-16 16:03       ` Patrick McHardy
2015-01-16 16:15         ` Thomas Graf
2015-01-16 16:32           ` Patrick McHardy
2015-01-16 16:38             ` Thomas Graf
2015-01-16 16:51               ` Patrick McHardy
2015-01-16 16:43             ` David Laight
2015-01-16 16:53               ` Thomas Graf
2015-01-16 18:36                 ` Patrick McHardy
2015-01-16 19:18                   ` Thomas Graf
2015-01-16 19:35                     ` Patrick McHardy
2015-01-16 20:46                       ` Pablo Neira Ayuso
2015-01-16 20:53                         ` Patrick McHardy
2015-01-19  9:01                         ` Paul E. McKenney [this message]
2015-01-21  5:23                           ` Herbert Xu
2015-01-21  5:29                             ` Paul E. McKenney
2015-01-21  5:30                               ` Herbert Xu
2015-01-21  5:36                                 ` Paul E. McKenney
2015-01-16 20:49                       ` Herbert Xu
2015-01-16 21:31                         ` Patrick McHardy
2015-01-17  0:33                           ` Herbert Xu
2015-01-17  8:06                             ` Patrick McHardy
2015-01-17  9:32                               ` Herbert Xu
2015-01-17  9:51                                 ` Patrick McHardy
2015-01-17 10:13                                   ` Herbert Xu
2015-01-17 11:56                                     ` Patrick McHardy
2015-01-16 21:36                       ` Thomas Graf
2015-01-16 22:07                         ` Patrick McHardy
2015-01-16 23:34                           ` Thomas Graf
2015-01-17  8:02                             ` Patrick McHardy
2015-01-19 12:58                               ` Thomas Graf
2015-01-19  9:45                         ` David Laight

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150119090121.GG9719@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=john.r.fastabend@intel.com \
    --cc=josh@joshtriplett.org \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=tgraf@suug.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).