Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jul 2013 09:17:53 +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:  <20130711061753.GK91021@kib.kiev.ua>
In-Reply-To: <CAJ-Vmo=icr6bda%2BWMNUarc3WbdqJ%2BMdauX6kByxxdTx8oSovBg@mail.gmail.com>
References:  <CAJ-Vmo=icr6bda%2BWMNUarc3WbdqJ%2BMdauX6kByxxdTx8oSovBg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--wMW4snQFzBrk6QzR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 10, 2013 at 04:36:23PM -0700, Adrian Chadd wrote:
> Hiya,
>=20
> I've started writing an aio_sendfile() syscall.
>=20
> http://people.freebsd.org/~adrian/ath/20130710-aio-sendfile-3.diff
>=20
> Yes, the diff is against -HEAD and not stable/9.
>=20
> It's totally horrible, hackish and likely bad. I've only done some
> very, very basic testing to ensure it actually works; i haven't at all
> stress tested it out yet. It's also very naive - I'm not at all doing
> any checks to see whether I can short-cut to do the aio there and
> then; I'm always queuing the sendfile() op through the worker threads.
> That's likely stupid and inefficient in a lot of cases, but it at
> least gets the syscall up and working.
Yes, it is naive, but for different reason.

The kern_sendfile() is synchronous function, it only completes after
the other end of the network communication allows it. This means
that calling kern_sendfile() from the aio thread blocks the thread
indefinitely by unbounded sleep.

Your implementation easily causes exhaustion of the aio thread pool,
blocking the whole aio subsystem. It is known that our aio does not work
for sockets for the same reason. I object against adding more code with
the same defect.

Proper route seems to rewrite aio for sockets using the upcalls.  The same
should be done for sendfile, if sendfile is given aio flavor.

>=20
> I'd like some feedback and possibly some help in stress testing it to
> make sure it's functioning well.
>=20
> Thanks,
>=20
>=20
> -adrian
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"

--wMW4snQFzBrk6QzR
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (FreeBSD)

iQIcBAEBAgAGBQJR3k4RAAoJEJDCuSvBvK1B+eUP+QFLTmvVepk5pm4zBtz0D0T3
FduAgbi4cUknborLn/ATcn09TuxeBCxxj224nOlnUYqi7Es7AXvYcs3UG3Y9jbZ8
Y+vhDvdGGW8o3Kb7h6bv0EnZVvOkFXx9A6+gVi4y9icGA8WP2mqHNhQynJHIjJbn
Ej2Ud0jPE4dyJeosMoHwGR40l+ESQ9Jb+ObBehNspyJBo6kY3aWXg6Rq6v2qdIwT
ZHv5e8ALO84CvxgUtFKZ0x+c50+qcks9R+ZZvBgqG3PS4RvEt0SKNy3aAi6bT5Y5
uBHYf0iWsTg4Bt7MJCLef0fb/Dw3FwkZfsK57h4w8HGwQpik9j8HpeZnVFH49x4h
5CvHECbRTdahnhs/iAv3c9HM2jVh5R9hmlGF46vET+wseIbObZByX/Fr8Va1ULly
79oxHc7BH+t5Hqu9xgyn3MCRnAf3455k3FDGSB9T7cJVeLv/yqpuPwRwvo/VhIaJ
O4AP9nXO+z2Jp+6ZhCxRv7mpZ4X/GNtvM5botA5khkUfxJdTdJY8W+bFUqUyiNDN
iVZvXcU5mHYIiQnkEQNLFYJRLpuO3BSJWBX+vXJWQUJcQSx8Ppf4U62wRw60/9R8
bEdhH5MFhHe1nArUdMoslBirnXVR0czxbCJgeSOu4boue6ayCI+055lxiJZlGyn5
HzvcvH4c/c54bAAXnat7
=TocX
-----END PGP SIGNATURE-----

--wMW4snQFzBrk6QzR--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130711061753.GK91021>