Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jan 2017 15:37:57 +0100
From:      Julien Charbon <jch@freebsd.org>
To:        Gleb Smirnoff <glebius@FreeBSD.org>, hiren@FreeBSD.org, Jason Eggleston <jeggleston@llnw.com>
Cc:        jtl@FreeBSD.org, rrs@FreeBSD.org, net@FreeBSD.org
Subject:   Re: listening sockets as non sockets
Message-ID:  <84f9c348-1e65-1b94-37a6-a4c67d195709@freebsd.org>
In-Reply-To: <20170127005251.GM2611@FreeBSD.org>
References:  <20170127005251.GM2611@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--mc4llJNOAcSIKKqbI6nk76vuCmWPKUGma
Content-Type: multipart/mixed; boundary="Bia7XafaO9k9cIeGEGeH9sxqELVnt3SLP";
 protected-headers="v1"
From: Julien Charbon <jch@freebsd.org>
To: Gleb Smirnoff <glebius@FreeBSD.org>, hiren@FreeBSD.org,
 Jason Eggleston <jeggleston@llnw.com>
Cc: jtl@FreeBSD.org, rrs@FreeBSD.org, net@FreeBSD.org
Message-ID: <84f9c348-1e65-1b94-37a6-a4c67d195709@freebsd.org>
Subject: Re: listening sockets as non sockets
References: <20170127005251.GM2611@FreeBSD.org>
In-Reply-To: <20170127005251.GM2611@FreeBSD.org>

--Bia7XafaO9k9cIeGEGeH9sxqELVnt3SLP
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable


 Hi Gleb,

On 1/27/17 1:52 AM, Gleb Smirnoff wrote:
>   as some of you already heard, I'm trying to separate listening socket=
s
> into a new file descriptor type. If we look into current struct socket,=

> we see that some functional fields belong to normal data flow sockets,
> and other belong to listening socket. They are never used simultaneousl=
y.
> Now, if we look at socket API, we see that once a socket underwent tran=
sformation
> to a listening socket, only 3 regular syscalls now may be called: liste=
n(2),
> accept(2) and close(2) and a subset of ioctl() and setsockopt() paramet=
ers is
> accepted. A listening socket cannot be closed from the protocol side, o=
nly from
> user side. So, listening socket is so different from a dataflow socket,=
 that
> separating them looks architecturally right thing to do.
>=20
> The benefits are:
>=20
> 1) Nicer code (I hope).
> 2) Smaller 'struct socket'.
> 3) Having two different locks for socket and solisten, we can try to ge=
t rid
>    of ACCEPT_LOCK global lock.
>=20
> The patch is in a very pre-alpha state. It has been run only in my bhyv=
e VM.
>=20
> It passes regression tests from tools/regression/sockets and tests/sys,=

> including the race tests, and including accept filter ones.
>=20
> For TCP it passes basic functionality testing, but likely there are sti=
ll races
> remaining after ACCEPT_LOCK removal.
> <snip>
> I've put current snapshot to Phab, so that you can view it there. The s=
nap
> patch is also attached to this email.
>=20
> https://reviews.freebsd.org/D9356
>=20
> At this moment I'd like to start doing some testing (and doing polishin=
g
> in parallel), and here I seek for your help. Those, who run FreeBSD at
> very high connection rates and observe contention on the accept global
> mutex, anybody willing to collaborate with me on this?

 Good idea, we are (obviously) interested by point #3 (Get rid of ACCEPT
global lock) and its connection rate scalability improvement.

 I might be able to look at potential race conditions related to
ACCEPT_LOCK and SO_ACCEPTFILTER usage (even if I am more used to
INP_INFO lock), but I can certainly provide performance numbers and lock
contention metrics using our setup.

 Do you think it is the right time to start performance testing with
your change?  Or it is a bit premature?

--
Julien


--Bia7XafaO9k9cIeGEGeH9sxqELVnt3SLP--

--mc4llJNOAcSIKKqbI6nk76vuCmWPKUGma
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQEcBAEBCgAGBQJYi1tLAAoJEKVlQ5Je6dhxK6cH/2pOgTzT9i1b1nvBbZi82p3D
ashJsxwEk/2gLcpDNlwrUL7K7Y/qea0Ah//isO47ZHc3qdZOZm7t9D1mr/hmoS6e
BJteTgYvvjhOiCradH8lB1LG6kNg+6vQsjsJ/AovepAonRrKnQl2dj6XgFpKDcHi
jCqcBW768lIl3FaW/geVwtACXqAeHMIXvg5ikeVM3MtG22H1mTmumMG8GsGu6QYs
zWxXdfL3CFAvyFArfUD+Gv2ng5sItCL3gDvo7KeolpHI0nwL297f4BmYkeuks773
4aAogg9Y3e5GkrxF1l56YA3EGg4mwOvLwhjb3OB0m4lW4R2B0Fx1jTFa76np/Ag=
=1tCk
-----END PGP SIGNATURE-----

--mc4llJNOAcSIKKqbI6nk76vuCmWPKUGma--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84f9c348-1e65-1b94-37a6-a4c67d195709>