Re: sendfile(2) SF_NOPUSH flag proposal

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

  • Next message: Igor Sysoev: "Re: sendfile(2) SF_NOPUSH flag proposal"
    Date: Wed, 28 May 2003 13:46:32 +0400 (MSD)
    To: Terry Lambert <tlambert2@mindspring.com>
    
    

    On Tue, 27 May 2003, Terry Lambert wrote:

    > Igor Sysoev wrote:
    > > How do suppose to coelesce the file pages ? Wire two or more pages
    > > to mbuf's at once ?
    >
    > It's done by the network driver, using the network card's DMA's
    > scatter/gather.

    Network driver already gathers file pages in current sendfile()
    implementation that wire one file page at once. And all the same
    sendfile() sometimes sends the partially filled packets. If you
    wire two or more pages at once then sendfile() would send the partially
    filled packets more rare but it will sends them all the same.

    > NOTE: TCP_NOPUSH *specifically* mentions writev(2), which, like
    > sendfile(2), takes data from multiple discrete buffers and sends
    > it.

    I agree with you, but writev() takes data from the memory while
    sendfile() can read it from a disk - it's one of the cause of the partially
    filled packets in the middle of the file stream. TF_NOPUSH (internal
    TCP_NOPUSH representation) can be used to avoid it.

    Suppose you have one page in VM and you need to read the next pages
    from a disk. What would you do ? If you send this single page - it
    will go as 1460, 1460 and 1176.

    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"