From owner-freebsd-arch@FreeBSD.ORG Wed May 28 22:11:09 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 3437137B401 for ; Wed, 28 May 2003 22:11:09 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F7E943FA3 for ; Wed, 28 May 2003 22:11:08 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc0vo.dialup.mindspring.com ([209.86.3.248] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19LFgv-0001ch-00; Wed, 28 May 2003 22:11:05 -0700 Message-ID: <3ED5961E.5DE0F41B@mindspring.com> Date: Wed, 28 May 2003 22:09:50 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Bill Fenner References: <200305281755.h4SHtbu05504@windsor.research.att.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a43029615e63b1f0affca9d6ea4bb7f791350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c 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: Thu, 29 May 2003 05:11:09 -0000 Bill Fenner wrote: > Why not set PRUS_MORETOCOME on all but the final pru_send() call? If the file is larger than `sysctl net.inet.tcp.sendspace`, then this code in do_sendfile(): if (sbspace(&so->so_snd) < so->so_snd.sb_lowat) { if (so->so_state & SS_NBIO) { m_freem(m); sbunlock(&so->so_snd); splx(s); error = EAGAIN; goto done; } error = sbwait(&so->so_snd); will result in you sleeping with PRUS_MORETOCOME set, but with no more being sent because the send buffer doesn't get emptied, as it's waiting for more data to send. -- Terry