All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	linux-sctp@vger.kernel.org, mleitner@redhat.com,
	vyasevic@redhat.com, daniel@iogearbox.net, davem@davemloft.net,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Xin Long <lucien.xin@gmail.com>
Subject: Re: [PATCH net-next 1/5] sctp: add the rhashtable apis for sctp global transport hashtable
Date: Wed, 30 Dec 2015 17:41:03 +0000	[thread overview]
Message-ID: <20151230174103.GC16270@localhost.localdomain> (raw)
In-Reply-To: <2c413161eb3a2c74453bd8dc11815af7e237515e.1451490447.git.lucien.xin@gmail.com>

On Wed, Dec 30, 2015 at 11:50:46PM +0800, Xin Long wrote:
...
> +void sctp_hash_transport(struct sctp_transport *t)
> +{
> +	struct sctp_sockaddr_entry *addr;
> +	struct sctp_hash_cmp_arg arg;
> +
> +	addr = list_entry(t->asoc->base.bind_addr.address_list.next,
> +			  struct sctp_sockaddr_entry, list);
> +	arg.laddr = &addr->a;
> +	arg.paddr = &t->ipaddr;
> +	arg.net   = sock_net(t->asoc->base.sk);
> +
> +reinsert:
> +	if (rhashtable_lookup_insert_key(&sctp_transport_hashtable, &arg,
> +					 &t->node, sctp_hash_params) = -EBUSY)
> +		goto reinsert;
> +}

This is the nasty situation I mentioned in previous email. It seems that
a stress test can trigger a double rehash and cause an entry to not be
added.

This is in fact very near some bugs you caught on rhashtable in the past
few days/couple of weeks tops.

I'm actually against this loop as is. I may have not been clear with Xin
about not adding my signature to the patchset due to this.

Please take a look at Xin's emails on thread 'rhashtable: Prevent
spurious EBUSY errors on insertion' about this particular situation.
Cc'ing Herbert as he wanted to see the patches for that issue.

  Marcelo


WARNING: multiple messages have this Message-ID (diff)
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	linux-sctp@vger.kernel.org, mleitner@redhat.com,
	vyasevic@redhat.com, daniel@iogearbox.net, davem@davemloft.net,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Xin Long <lucien.xin@gmail.com>
Subject: Re: [PATCH net-next 1/5] sctp: add the rhashtable apis for sctp global transport hashtable
Date: Wed, 30 Dec 2015 15:41:03 -0200	[thread overview]
Message-ID: <20151230174103.GC16270@localhost.localdomain> (raw)
In-Reply-To: <2c413161eb3a2c74453bd8dc11815af7e237515e.1451490447.git.lucien.xin@gmail.com>

On Wed, Dec 30, 2015 at 11:50:46PM +0800, Xin Long wrote:
...
> +void sctp_hash_transport(struct sctp_transport *t)
> +{
> +	struct sctp_sockaddr_entry *addr;
> +	struct sctp_hash_cmp_arg arg;
> +
> +	addr = list_entry(t->asoc->base.bind_addr.address_list.next,
> +			  struct sctp_sockaddr_entry, list);
> +	arg.laddr = &addr->a;
> +	arg.paddr = &t->ipaddr;
> +	arg.net   = sock_net(t->asoc->base.sk);
> +
> +reinsert:
> +	if (rhashtable_lookup_insert_key(&sctp_transport_hashtable, &arg,
> +					 &t->node, sctp_hash_params) == -EBUSY)
> +		goto reinsert;
> +}

This is the nasty situation I mentioned in previous email. It seems that
a stress test can trigger a double rehash and cause an entry to not be
added.

This is in fact very near some bugs you caught on rhashtable in the past
few days/couple of weeks tops.

I'm actually against this loop as is. I may have not been clear with Xin
about not adding my signature to the patchset due to this.

Please take a look at Xin's emails on thread 'rhashtable: Prevent
spurious EBUSY errors on insertion' about this particular situation.
Cc'ing Herbert as he wanted to see the patches for that issue.

  Marcelo

  parent reply	other threads:[~2015-12-30 17:41 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30 15:50 [PATCH net-next 0/5] sctp: use transport hashtable to replace association's with rhashtable Xin Long
2015-12-30 15:50 ` Xin Long
2015-12-30 15:50 ` [PATCH net-next 1/5] sctp: add the rhashtable apis for sctp global transport hashtable Xin Long
2015-12-30 15:50   ` Xin Long
2015-12-30 15:50   ` [PATCH net-next 2/5] sctp: apply rhashtable api to send/recv path Xin Long
2015-12-30 15:50     ` Xin Long
2015-12-30 15:50     ` [PATCH net-next 3/5] sctp: apply rhashtable api to sctp procfs Xin Long
2015-12-30 15:50       ` Xin Long
2015-12-30 15:50       ` [PATCH net-next 4/5] sctp: drop the old assoc hashtable of sctp Xin Long
2015-12-30 15:50         ` Xin Long
2015-12-30 15:50         ` [PATCH net-next 5/5] sctp: remove the local_bh_disable/enable in sctp_endpoint_lookup_assoc Xin Long
2015-12-30 15:50           ` Xin Long
2016-01-05 19:07     ` [PATCH net-next 2/5] sctp: apply rhashtable api to send/recv path Vlad Yasevich
2016-01-05 19:07       ` Vlad Yasevich
2016-01-06 16:18       ` Xin Long
2016-01-06 16:18         ` Xin Long
2016-01-06 17:42       ` mleitner
2016-01-06 17:42         ` mleitner
2016-01-11 15:00         ` Vlad Yasevich
2016-01-11 15:00           ` Vlad Yasevich
2015-12-30 16:57   ` [PATCH net-next 1/5] sctp: add the rhashtable apis for sctp global transport hashtable Eric Dumazet
2015-12-30 16:57     ` Eric Dumazet
2015-12-30 17:50     ` David Miller
2015-12-30 17:50       ` David Miller
2016-01-11  9:32       ` Herbert Xu
2016-01-11  9:32         ` Herbert Xu
2016-01-11 16:33         ` Marcelo Ricardo Leitner
2016-01-11 16:33           ` Marcelo Ricardo Leitner
2016-01-11 18:08           ` Vlad Yasevich
2016-01-11 18:08             ` Vlad Yasevich
2016-01-11 18:19             ` Marcelo Ricardo Leitner
2016-01-11 18:19               ` Marcelo Ricardo Leitner
2015-12-30 17:41   ` Marcelo Ricardo Leitner [this message]
2015-12-30 17:41     ` Marcelo Ricardo Leitner
2016-01-05 10:10     ` Xin Long
2016-01-05 10:10       ` Xin Long
2016-01-11  9:22       ` Herbert Xu
2016-01-11  9:22         ` Herbert Xu
2016-01-05 18:38   ` Vlad Yasevich
2016-01-05 18:38     ` Vlad Yasevich
2016-01-06 17:01     ` Xin Long
2016-01-06 17:01       ` Xin Long
2016-01-06 18:19       ` Marcelo Ricardo Leitner
2016-01-06 18:19         ` Marcelo Ricardo Leitner
2016-01-07 17:23         ` Marcelo Ricardo Leitner
2016-01-07 17:23           ` Marcelo Ricardo Leitner
2016-01-07 20:28       ` Vlad Yasevich
2016-01-07 20:28         ` Vlad Yasevich
2016-01-11  9:30   ` Herbert Xu
2016-01-11  9:30     ` Herbert Xu
2016-01-11 16:00     ` mleitner
2016-01-11 16:00       ` mleitner
2016-01-11 17:20       ` Vlad Yasevich
2016-01-11 17:20         ` Vlad Yasevich
2016-01-11 18:09         ` mleitner
2016-01-11 18:09           ` mleitner
2016-01-11 21:35           ` David Miller
2016-01-11 21:35             ` David Miller
2016-01-11 21:31         ` David Miller
2016-01-11 21:31           ` David Miller
2015-12-30 17:19 ` [PATCH net-next 0/5] sctp: use transport hashtable to replace association's with rhashtable Eric Dumazet
2015-12-30 17:19   ` Eric Dumazet
2015-12-30 17:32   ` Marcelo Ricardo Leitner
2015-12-30 17:32     ` Marcelo Ricardo Leitner
2015-12-30 19:11     ` Eric Dumazet
2015-12-30 19:11       ` Eric Dumazet
2015-12-30 20:44       ` David Miller
2015-12-30 20:44         ` David Miller
2015-12-30 21:57         ` Eric Dumazet
2015-12-30 21:57           ` Eric Dumazet
2015-12-30 22:29           ` Marcelo Ricardo Leitner
2015-12-30 22:29             ` Marcelo Ricardo Leitner
2015-12-30 17:52   ` David Miller
2015-12-30 17:52     ` David Miller
2015-12-30 19:03     ` Eric Dumazet
2015-12-30 19:03       ` Eric Dumazet
2015-12-30 20:40       ` David Miller
2015-12-30 20:40         ` David Miller
2016-01-04 22:30 ` David Miller
2016-01-04 22:30   ` David Miller

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=20151230174103.GC16270@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=mleitner@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=vyasevic@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.