From owner-freebsd-arch@FreeBSD.ORG Wed Apr 26 22:18:56 2006 Return-Path: X-Original-To: arch@freebsd.org 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 47C8516A400 for ; Wed, 26 Apr 2006 22:18:56 +0000 (UTC) (envelope-from ken@nargothrond.kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA28A43D45 for ; Wed, 26 Apr 2006 22:18:55 +0000 (GMT) (envelope-from ken@nargothrond.kdm.org) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.13.6/8.13.6) with ESMTP id k3QMIrgL094769; Wed, 26 Apr 2006 16:18:53 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.13.6/8.13.6/Submit) id k3QMIqiR094768; Wed, 26 Apr 2006 16:18:52 -0600 (MDT) (envelope-from ken) Date: Wed, 26 Apr 2006 16:18:52 -0600 From: "Kenneth D. Merry" To: Alexander Kabaev Message-ID: <20060426221852.GA94673@nargothrond.kdm.org> References: <200604240633.k3O6XUJ0042841@chez.mckusick.com> <20060424064352.GA728@funkthat.com> <444C765B.7070803@elischer.org> <20060424192414.0dbaa534@kan.dnsalias.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060424192414.0dbaa534@kan.dnsalias.net> User-Agent: Mutt/1.4.2i X-Virus-Scanned: ClamAV 0.88.1/1426/Wed Apr 26 12:03:01 2006 on nargothrond.kdm.org X-Virus-Status: Clean Cc: Kirk McKusick , arch@freebsd.org, John-Mark Gurney , Julian Elischer Subject: Re: Linus Torvalds on FreeBSD's Use of Copy-on-write X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2006 22:18:56 -0000 On Mon, Apr 24, 2006 at 19:24:14 -0400, Alexander Kabaev wrote: > On Sun, 23 Apr 2006 23:55:23 -0700 > Julian Elischer wrote: > > > John-Mark Gurney wrote: > > > > >Kirk McKusick wrote this message on Sun, Apr 23, 2006 at 23:33 -0700: > > > > > > > > >>Linus explained that while this may look good on specific > > >>benchmarks, it actually introduces extra overhead, "the thing is, > > >>the cost of > > >> > > >> > > > > > >Has he benchmarked this to prove his point? And has he done it over > > >realworld work loads, like Apache or another "standard" program > > >instead of a microbenchmark designed especially to make COW look bad? > > > > > > > > > > Well no-one has even confirmed that freeBSD does all this > > "page flipping" etc. I doubt that Linus has looked inside the BSD > > kernels. He's probably just repeating what he's been told, and that's > > so accurate, right? > > > > I know that freeBSD developers have over the last few years also > > acknowledged that > > the speed of modern CPUs vs. memeory speeds makes it often less > > efficient to do certain optimisations than it used to be. > > > > > > > > > > >As w/ all theories, w/o numbers, they are only theories till backed > > >up w/ benchmarks. > > > > > >This isn't suppose to defend COW, but it is designed to ensure that > > >people don't stop exploring just because someone says something... > > > > > > > > > > > _______________________________________________ > > freebsd-arch@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > > To unsubscribe, send any mail to > > "freebsd-arch-unsubscribe@freebsd.org" > The original zero-copy code was used to stream network data directly to > an onboard SDRAM memory on an extension PCI card. Linus' notes about > relative cost of memory-to-memory copies vs. TLB shootdowns and possible > page access traps had little relevance there. If you're talking about the code I wrote at Pluto/Avid, yeah, it was primarily to get around very poor CPU access speed to the external RAID cache we had on that box. The zero copy send model used async I/O semantics -- you'd get the completed buffers back when they were freed, so you knew you could reuse them in userland. The zero copy receive model relied on extensive modifications to the Alteon Tigon II firmware -- a whole lot more than the header splitting firmware that's in the FreeBSD tree now. I added 16 extra receive rings to the firmware to handle up to 16 incoming FTP connections. Packet headers were DMAed into normal kernel memory, and the payloads were DMAed into the PCI attached RAID cache. Since neither implementation was generally useful, Drew Gallatin and I cleaned up his zero copy sockets implementation for inclusion in FreeBSD. The receive semantics with respect to userland were similar to what I did at Pluto/Avid, but the send semantics are somewhat different, since they rely on COW instead of a separate notification that the buffer is done. Is any of that old codebase still in use? I figured it probably went away with the old hardware... Ken -- Kenneth Merry ken@FreeBSD.ORG