From owner-freebsd-arch@FreeBSD.ORG Tue May 27 08:59:34 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 495C037B401 for ; Tue, 27 May 2003 08:59:34 -0700 (PDT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78A0743F75 for ; Tue, 27 May 2003 08:59:32 -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 h4RFxUmF020137; Tue, 27 May 2003 19:59:30 +0400 (MSD) Date: Tue, 27 May 2003 19:59:30 +0400 (MSD) From: Igor Sysoev X-Sender: is@is To: Terry Lambert In-Reply-To: <3ED3844F.713FB360@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: Tue, 27 May 2003 15:59:34 -0000 On Tue, 27 May 2003, Terry Lambert wrote: > Peter Jeremy wrote: > > On Tue, May 27, 2003 at 11:57:20AM +0400, Igor Sysoev wrote: > > >I thought about it more and I agree with you. TF_NOPUSH should be turned on > > >at the start of a transaction and turned off at the end of a transaction. > > > > > >So I think there should be two flags: > > >SF_NOPUSH - it turns TF_NOPUSH on before the sending. It's cheap: > > >SF_PUSH - it turns TF_NOPUSH off after the sending has been completed. > > > > I agree that the code appears trivial but in order to justify its > > inclusion, you will need to demonstrate that there is some benefit to > > FreeBSD to implement this code. Good justification would be: > > > > 1) The same API is implemented somewhere else (or there is agreement > > between multiple groups to implement it). I don't believe this > > functionality is implemented anywhere else and you've not provided > > any evidence that any other groups are considering such functionality. > > Actually, the functionality can be implemented *without* going > and implementing the API. It should really be contrlled already > by the TCP_NODELAY option *not* having been set by the user, and, > for last-block next-first-block coelescing, by TCP_NOPUSH *having* > been set. It's not an implementing the API. It's an addition to the already existed API - sendfile(2). sendfile(2) already has the flags parameter and this parameter is currently unused and should be zero. I propose two sendfile(2) flags - SF_NOPUSH and SF_PUSH. > > 2) The new feature provides significant performance benefit. In this > > case, I believe the overhead of calling setsockopt(2) is negligible > > so the performance gain would be negligible. > > The overhead of toggling it would be costly. However, I really > don't understand why he isn't just not setting TCP_NODELAY in > the first place, since it's an affirmative option, and then > leaaving the socket alone to act like it's supposed to act. TCP_NODELAY is not set. Igor Sysoev http://sysoev.ru/en/