Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2003 13:46:32 +0400 (MSD)
From:      Igor Sysoev <is@rambler-co.ru>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        arch@freebsd.org
Subject:   Re: sendfile(2) SF_NOPUSH flag proposal
Message-ID:  <Pine.BSF.4.21.0305281324220.50420-100000@is>
In-Reply-To: <3ED44F2D.DAF1FA08@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0305281324220.50420-100000>