From owner-freebsd-arch@FreeBSD.ORG Wed May 28 02:46:37 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 31D9537B401 for ; Wed, 28 May 2003 02:46:37 -0700 (PDT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id B750843FA3 for ; Wed, 28 May 2003 02:46:35 -0700 (PDT) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id h4S9kWmF038952; Wed, 28 May 2003 13:46:32 +0400 (MSD) Date: Wed, 28 May 2003 13:46:32 +0400 (MSD) From: Igor Sysoev X-Sender: is@is To: Terry Lambert In-Reply-To: <3ED44F2D.DAF1FA08@mindspring.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: sendfile(2) SF_NOPUSH flag proposal X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2003 09:46:37 -0000 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/