From owner-freebsd-arch@FreeBSD.ORG Mon Apr 24 17:35:03 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 804B816A400 for ; Mon, 24 Apr 2006 17:35:03 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from pproxy.gmail.com (pproxy.gmail.com [64.233.166.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE04943D46 for ; Mon, 24 Apr 2006 17:35:02 +0000 (GMT) (envelope-from jfvogel@gmail.com) Received: by pproxy.gmail.com with SMTP id t32so1069627pyc for ; Mon, 24 Apr 2006 10:35:01 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ccvw7rKHR5RPyOly/LIYMsfj5Z/Lv1EoCPvG/u6kw4QuJ2tuKEHs5yZVAygE5QWhjyACohFFMJq+bi+qJJZ4wx/J3g/LGBX8D6HMJB7dka2Sqol2iGFr/4K/8vGPo0bhp+ykzZ6+tZ1mpEOAejH6hD0QoHOCTATgPHSXyrfDVto= Received: by 10.35.113.12 with SMTP id q12mr1378214pym; Mon, 24 Apr 2006 10:35:01 -0700 (PDT) Received: by 10.35.17.16 with HTTP; Mon, 24 Apr 2006 10:35:01 -0700 (PDT) Message-ID: <2a41acea0604241035s325bf2c3x96baac71eff3e7db@mail.gmail.com> Date: Mon, 24 Apr 2006 10:35:01 -0700 From: "Jack Vogel" To: "Kirk McKusick" In-Reply-To: <200604240633.k3O6XUJ0042841@chez.mckusick.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200604240633.k3O6XUJ0042841@chez.mckusick.com> Cc: arch@freebsd.org 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: Mon, 24 Apr 2006 17:35:03 -0000 On 4/23/06, Kirk McKusick wrote: > Anyone working on zero-copy sockets care to respond to this? > > http://developers.slashdot.org/developers/06/04/21/1536213.shtml > > Linus Torvalds made reference to some possible future extensions. > This included vmsplice(), a system call since implemented by Jens > Axboe "to basically do a 'write to the buffer', but using the > reference counting and VM traversal to actually fill the buffer." > Reviewing the implications of using such a system call lead to a > comparison with FreeBSD's ZERO_COPY_SOCKET which uses COW (copy on > write). > > Linus explained that while this may look good on specific benchmarks, > it actually introduces extra overhead, "the thing is, the cost of > marking things COW is not just the cost of the initial page table > invalidate: it's also the cost of the fault eventually when you > _do_ write to the page, even if at that point you decide that the > page is no longer shared, and the fault can just mark the page > writable again." He went on to explain, "The COW approach does > generate some really nice benchmark numbers, because the way you > benchmark this thing is that you never actually write to the user > page in the first place, so you end up having a nice benchmark loop > that has to do the TLB invalidate just the _first_ time, and never > has to do any work ever again later on." Linus didn't pull any > punches when he summarized: > > "I claim that Mach people (and apparently FreeBSD) are incompetent > idiots. Playing games with VM is bad. memory copies are _also_ > bad, but quite frankly, memory copies often have _less_ downside > than VM games, and bigger caches will only continue to drive > that point home." I would have expected something a bit less adolescent out of Linus, or maybe its the reporter.... I don't think it deserves a reply however. Jack