Re: hacking - aio_sendfile()

看板FB_current作者時間12年前 (2013/07/12 03:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串12/16 (看更多)
--5P5znCSOQSukcar1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 11, 2013 at 11:44:32AM -0700, Scott Long wrote: >=20 > On Jul 10, 2013, at 11:17 PM, Konstantin Belousov <kostikbel@gmail.com> w= rote: >=20 > > 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. > >=20 > > 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. >=20 >=20 > No, kern_sendfile is async unless you specify the SF_SYNC hack flag. > Otherwise, it'll fill the socket buffer and then return immediately, unle= ss > the socket buffer is full and the socket is set to blocking mode. That's > outside the scope, as I said in my previous email. You do not understand what I said, please re-read both my mail and code before replying. Implementing aio_sendfile() as proposed would create yet another possibility of indefinitely block all processes using aio. --5P5znCSOQSukcar1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJR3v4CAAoJEJDCuSvBvK1Bu7UP/1llBUEzZfnkb9CdwgTw74TB DMuWAa+d8UfqDEIVy7qfSqFwbqHmZUixnGmWc+WjHAOFeu7+rt55kb6kAZRdw16Q 5bGSkA8c7ZOApx9Gr73fIDj9pThtX0NG8QKkzMEX8hcPY0qQSIG2LbEWm5e2DXa2 2WRZh/nwVfn4NOxQo1ynaWB/XUFNyCBTeCTVKVLy4fBi+en0VduiSYLWzoysxW1u 0ojZOoI6JYT+53KctMofcwXFzKxTDnj/FWDqSh2P0DroAklwiVK/HuXG0fX0Q2ua xDyc2Jcx9K631In1BDEs9qf4k57zt/SPGkk1aNoGHPoM0g7LexT0GtwO18EN/1og Xje1wtEOVfVDjJBxZyICHiM4fV/fx/QLyKarEz/ut/tdf8QSD4bgQfRfMTYVkE5F kU3uCyoZDUxE4WOBsaSVjqAMKAMbIck4/hRpc1laMe4AvUsU8hFYMSYQ3RlOUmOd wf4uHxEIW+uuN55UCLFq1cPN5DzhHLgbOck5gqaiJQ+6F0q7a9nWc1pH9cFlWA0e Mjk/dMW+iQfXD/BgErzxD1y4z31ZqvPfiRdlhukNqkbPhz2xuLoRxxVLwJnfkEXz w11IpwnC+EdMAjuyBmHE6jz2vz3V1OdHovt0EudnSTXTrsTd81Fq9BIz+QnV0rLo XV6WmPUedN8J5XZpUsNq =15e2 -----END PGP SIGNATURE----- --5P5znCSOQSukcar1--
文章代碼(AID): #1Htm3kTM (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1Htm3kTM (FB_current)