Re: sendfile(2) SF_NOPUSH flag proposal

From: Igor Sysoev (is_at_rambler-co.ru)
Date: 05/29/03

  • Next message: Igor Sysoev: "Re: sendfile(2) SF_NOPUSH flag proposal"
    Date: Thu, 29 May 2003 11:53:05 +0400 (MSD)
    To: Terry Lambert <tlambert2@mindspring.com>
    
    

    On Wed, 28 May 2003, Terry Lambert wrote:

    > Igor Sysoev wrote:

    > > The portability argument is bogus because sendfile() portability is nonsense.
    >
    > Darwin has sendfile. See the released source code: it matches
    > the FreeBSD semantics, from what I can tell.

    So now FreeBSD/Darwin is second pair after AIX/MVS that has the same sendfile()
    prototype. It surely improves the sendfile() portability. Undoubtedly.

    > > The drawback that really annoyed me is that sendfile() blocks on a reading
    > > from a disk while a sending to non-blocking socket. Although I see three
    > > workarounds it's much better to fix this inside sendfile().
    >
    > There's no workaround for the latency issue, which comes from
    > the fact that a trap handles the request for more pages, and
    > that blocks all callers. Threads has the same problem in libc_r.

    The workaround idea is simple - a preloading. But implementation on user
    level is complex. In FreeBSD 4.x I see three ways:

    *) the use of aio_read() to read the single bytes;
    *) the use rfork()ed helper processes to read the single bytes;
    *) and the use the pool of rfork()ed processes to handle connections.

    But all of them requires significant changes of an application.

    > > Five people ?
    >
    > Bill Fenner, Matt Dillon, Peter Jeremy, Marc Slemko, Terry Lambert,
    > Garance Droshin.

    At time of your mail there were only 4 people, in order of appearance:
    Peter Jeremy, you, Matt Dillon, and Marc Slemko. Bill Fenner's email
    was sent one and a half hour after yours and just before my response.
    Garance Droshin's mail was sent several hours later.

    Igor Sysoev
    http://sysoev.ru/en/

    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"


  • Next message: Igor Sysoev: "Re: sendfile(2) SF_NOPUSH flag proposal"

    Relevant Pages

    • Re: sendfile(2) SF_NOPUSH flag proposal
      ... It surely improves the sendfile() portability. ... FreeBSD, NetBSD, OpenBSD, Darwin. ... This is because a fault on a user page results in entering ... >> Garance Droshin. ...
      (freebsd-arch)
    • Re: sendfile(2) SF_NOPUSH flag proposal
      ... > There's no sendfileimplementation in NetBSD and OpenBSD. ... Or you could just fix sendfile. ... Does this mean that FreeBSD should not introduce any ...
      (freebsd-arch)
    • Re: sendfile(2) SF_NOPUSH flag proposal
      ... On Mon, 26 May 2003, Terry Lambert wrote: ... I know some other drawbacks but I do not see now the ways to resolve them. ... It allows to save two syscalls on each sendfile() call ... FreeBSD 4.x has no zero_copyso mmaped files would be copied. ...
      (freebsd-arch)
    • Re: sendfile(2) SF_NOPUSH flag proposal
      ... >> which have the FreeBSD syntax. ... There are two projects on NetBSD, one is rather stale, but it's ... > the FreeBSD compatible sendfile() then he can simply ignore any unsupported ... And have any code that uses your new flags not compile for ...
      (freebsd-arch)
    • Re: sendfile(2) SF_NOPUSH flag proposal
      ... On Wed, 28 May 2003, Terry Lambert wrote: ... I do want these flags because they resolve the problem of partially ... the sendfile() implementation. ... workarounds it's much better to fix this inside sendfile. ...
      (freebsd-arch)