netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jbacik@fb.com
Cc: hannes@stressinduktion.org, kraigatgoog@gmail.com,
	eric.dumazet@gmail.com, tom@herbertland.com,
	netdev@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 6/6 net-next] inet: reset tb->fastreuseport when adding a reuseport sk
Date: Fri, 23 Dec 2016 14:00:21 -0500 (EST)	[thread overview]
Message-ID: <20161223.140021.2268153215775836066.davem@davemloft.net> (raw)
In-Reply-To: <1482441998-28359-7-git-send-email-jbacik@fb.com>

From: Josef Bacik <jbacik@fb.com>
Date: Thu, 22 Dec 2016 16:26:38 -0500

> @@ -74,12 +74,16 @@ struct inet_ehash_bucket {
>   * users logged onto your box, isn't it nice to know that new data
>   * ports are created in O(1) time?  I thought so. ;-)	-DaveM
>   */
> +#define FASTREUSEPORT_ANY	1
> +#define FASTREUSEPORT_STRICT	2
> +
>  struct inet_bind_bucket {
>  	possible_net_t		ib_net;
>  	unsigned short		port;
>  	signed char		fastreuse;
>  	signed char		fastreuseport;
>  	kuid_t			fastuid;
> +	struct sock_common	fastsock;
>  	int			num_owners;
>  	struct hlist_node	node;
>  	struct hlist_head	owners;

I understand why you did this fastsock thing, it's the easiest way out.

But it is so wasteful, but in space and time.  You have to store an entire fake
socket here, but there is not need for anything other than the recv saddr
member(s).

And you have to copy the whole thing to store the state, which again
is almost entirely unnecessary.

You really just need to store only the required state, and abstract the
AF specific bits properly.

  parent reply	other threads:[~2016-12-23 19:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22 21:26 [PATCH 0/6 net-next][V2] Rework inet_csk_get_port Josef Bacik
2016-12-22 21:26 ` [PATCH 1/6 net-next] inet: collapse ipv4/v6 rcv_saddr_equal functions into one Josef Bacik
2016-12-22 21:26 ` [PATCH 2/6 net-next] inet: drop ->bind_conflict Josef Bacik
2016-12-22 21:26 ` [PATCH 3/6 net-next] inet: kill smallest_size and smallest_port Josef Bacik
2016-12-22 22:41   ` Eric Dumazet
2016-12-22 21:26 ` [PATCH 4/6 net-next] inet: don't check for bind conflicts twice when searching for a port Josef Bacik
2016-12-23 18:58   ` David Miller
2016-12-22 21:26 ` [PATCH 5/6 net-next] inet: split inet_csk_get_port into two functions Josef Bacik
2016-12-22 21:26 ` [PATCH 6/6 net-next] inet: reset tb->fastreuseport when adding a reuseport sk Josef Bacik
2016-12-22 22:43   ` Eric Dumazet
2016-12-23 19:00   ` David Miller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-01-11 20:06 [PATCH 0/6 net-next][V3] Rework inet_csk_get_port Josef Bacik
2017-01-11 20:22 ` [PATCH 2/6 net-next] inet: drop ->bind_conflict Josef Bacik
2017-01-11 20:22   ` [PATCH 6/6 net-next] inet: reset tb->fastreuseport when adding a reuseport sk Josef Bacik
2017-01-17 15:51 [PATCH 0/6 net-next][V4] Rework inet_csk_get_port Josef Bacik
2017-01-17 15:51 ` [PATCH 6/6 net-next] inet: reset tb->fastreuseport when adding a reuseport sk Josef Bacik

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=20161223.140021.2268153215775836066.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=hannes@stressinduktion.org \
    --cc=jbacik@fb.com \
    --cc=kernel-team@fb.com \
    --cc=kraigatgoog@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=tom@herbertland.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 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).