From owner-freebsd-arch@FreeBSD.ORG Wed May 28 13:02: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 DA77137B401 for ; Wed, 28 May 2003 13:02:34 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 628F943FBF for ; Wed, 28 May 2003 13:02:32 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.9/8.12.6) with ESMTP id h4SK2WVI073965; Wed, 28 May 2003 13:02:32 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9/8.12.6/Submit) id h4SK2WUr073964; Wed, 28 May 2003 13:02:32 -0700 (PDT) Date: Wed, 28 May 2003 13:02:32 -0700 (PDT) From: Matthew Dillon Message-Id: <200305282002.h4SK2WUr073964@apollo.backplane.com> To: Bill Fenner References: <200305281755.h4SHtbu05504@windsor.research.att.com> 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 20:02:35 -0000 : :Why not set PRUS_MORETOCOME on all but the final pru_send() call? : : Bill An excellent idea, Bill, it would work. Some additional modifications would have to be done to the fo_write() and writev() interfaces but it looks quite reasonable (and non-hackish) to me. A new FOF_ flag would have to be added to allow the caller of fo_write() to specify that there is more data to come, e.g. FOF_MORETOCOME, which would be translated to PRUS_MORETOCOME in sosend(). writev() would have to be split into a writev() syscall and a do_writev() implementation instead of the two being combined like they are now. Then do_sendfile() could call the do_writev() implementation in order to pass additional flags (aka FOF_MORETOCOME) to it, rather then call the writev() sys call. Additionally, the writev() implementation could set FOF_MORETOCOME for all but the last iovec under normal conditions (and use the passed flag for the last iovec). This would actually improve any C code that uses writev() on sockets regardless of whether sendfile() is fixed or not. I'm afraid I do not have time to actually implement this right now, but I think it's simple enough that virtually any kernel programmer could do it in a day or less. I think these changes would be an excellent and non-hackish addition to FreeBSD. -Matt Matthew Dillon