Date: Thu, 11 Jul 2013 12:56:15 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Adrian Chadd <adrian@freebsd.org> Cc: freebsd-current <freebsd-current@freebsd.org> Subject: Re: hacking - aio_sendfile() Message-ID: <20130711095615.GM91021@kib.kiev.ua> In-Reply-To: <CAJ-Vmo=ic_KuaaE2avvbX3JE=R25nuRyyAQpEmFrZRp7T9y9qg@mail.gmail.com> References: <CAJ-Vmo=icr6bda%2BWMNUarc3WbdqJ%2BMdauX6kByxxdTx8oSovBg@mail.gmail.com> <20130711061753.GK91021@kib.kiev.ua> <CAJ-VmomFcZv6_uhpy6ShBzL21=Fqw7_y2xE2oYGod2T=Z5Qgpg@mail.gmail.com> <20130711093630.GL91021@kib.kiev.ua> <CAJ-Vmo=ic_KuaaE2avvbX3JE=R25nuRyyAQpEmFrZRp7T9y9qg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--5A5licVS1j+RWz1s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 11, 2013 at 02:39:00AM -0700, Adrian Chadd wrote: > On 11 July 2013 02:36, Konstantin Belousov <kostikbel@gmail.com> wrote: >=20 > > No, it is not disk I/O which is problematic there. It is socket I/O > > e.g. wait for the socket buffers lomark in the kern_sendfile() which > > causes unbounded sleep. Look for the sbwait() call, both in the > > kern_sendfile() itself, and in the pru_send methods of the protocols, > > e.g. in sosend_generic(). The wait scope controlled by the other side of > > connection and allow it to completely block the aio subsystem. > > > > Disk I/O is supposed to finish in the finite time. >=20 > Even if the destination socket is marked as NONBLOCK? You mean, would a sleep for the socket buffer space cause aio thread block is the socket is put in nonblocking mode ? Or something else ? No, it would not block the thread. But I cannot consider the aio_sendfile(2) implementation useful if it requires non-blocking socket. Also, what about other thread changing the socket to blocking mode while sendfile is in flight ? --5A5licVS1j+RWz1s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJR3oE/AAoJEJDCuSvBvK1BQoAQAKhbJwA4NzJFbCkYUGgnO2CY 0c0NTia6bqUhHNCHhWPDyhHE5J0JpyUQLmARA1mSzLpwzy/g/b62gcm2tyxHt625 iYmbzT1sU0AOuWjLhM7KjWo3ekKkueniQEY78kXbNAYCVt7Fa8XXyz5t4UcDQFBv IR6xqdsaq12Sk/nL7d6S6g/vAkaE2tTr71KxUskhFzi61SRdIpT3sV/Moy/C3UxE +6ZUvpliN90oen2/iudVC6Yao0y4kma/4cFTVznHZ4hB8SlzdxSvH5CHZH3sr8Q8 73f4agB+b2W3SUH/746CTmZBFYXsHDmvZyIqsf1VjG4toJq4dYKiyK9WhQs1tYNE V63pE1OWWi1Aa7k5XpwFff0wDAQwzI245r2+Gi6Axt2Id6+LUTR56jEFjggH/3z2 go2aBf8FJVBAfi6TUldhusKLynpMV0cwU3Xp427mnAF5dw5w4yOlSCTo/TIarreH RQFJn5arECjb1IFfZzXZx4wXPTSH/UbEdaa2W2NYsPfFPg6SKRIP9nG3uriMOaOP MONvakr95uVmc4j2ElJ9rCg4apNp/eFEucwB1gVLcXPFiUn/APUDMpaxxDAJuTWG cCwCzpx/MaLGW5vvp5C2vZ5lWE53y5a7Ew2ozM/Q70U/2meB6mmj67X7k4XB0BgN bgXXLx2/4txXNW4E6Ott =d5Be -----END PGP SIGNATURE----- --5A5licVS1j+RWz1s--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130711095615.GM91021>