From owner-freebsd-arch@FreeBSD.ORG Wed May 31 20:29:37 2006 Return-Path: X-Original-To: freebsd-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 0E28C16A6DF for ; Wed, 31 May 2006 20:29:37 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id E966943D58 for ; Wed, 31 May 2006 20:29:35 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: by wx-out-0102.google.com with SMTP id s17so81117wxc for ; Wed, 31 May 2006 13:29:35 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kyB7hT1gh0WZwQkDS9zI10ektLcvvwrpFzPJjIjx4kJVAOWmgWliBebeiSbCieUqcqtXLcVYxN7fcVasmB+oo9+4QPZrz9Dh1CrkqWuN70deVjp9oBSdeub0iQCI0KK9rudjtmU5VraU3Z6ofC7N+PEIApwW/Qt4dhwR1i5bxis= Received: by 10.70.68.10 with SMTP id q10mr695097wxa; Wed, 31 May 2006 13:29:34 -0700 (PDT) Received: by 10.70.11.2 with HTTP; Wed, 31 May 2006 13:29:34 -0700 (PDT) Message-ID: <3bbf2fe10605311329h7adc1722j9088253515e0265b@mail.gmail.com> Date: Wed, 31 May 2006 22:29:34 +0200 From: "Attilio Rao" To: "Suleiman Souhlal" , freebsd-arch@freebsd.org, freebsd-hackers@freebsd.org In-Reply-To: <447DFA0C.20207@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3bbf2fe10605311156p7e629283r34d22b368877582d@mail.gmail.com> <447DFA0C.20207@FreeBSD.org> Cc: Subject: Re: [patch] Adding optimized kernel copying support - Part III X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rookie@gufi.org List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2006 20:29:42 -0000 2006/5/31, Suleiman Souhlal : > Hello Attilio, Hello Suleiman, > Nice work. Any chance you could also port it to amd64? :-) Not in the near future, I think. :P > Does that mean it won't work with SMP and PREEMPTION? Yes it will work (even if I think it needs more testing) but maybe would give lesser performances on SMP|PREEMPTION due to too much traffic on memory/cache. For this I was planing to use non-temporal instructions (obviously benchmarks would be very appreciate). > What kind of performance improvements did you see in your benchmarks? I'm sorry but I didn't benchmarked on P4 (with xmm instructions). On P3, using integer copies, with dd and time I measured about 2% increasing, I hope more on P4 (and you might add xmm usage too). > I wonder if we could get rid of the memcpy_vector (copyin/copyout_vector > before this patch), bzero_vector and bcopy_vector function pointers and > do boot-time patching of the callers to the right version Mmm, please note that on i386, at boot time (I've never studied that code) it seems requiring of vectorized version of bcopy/bzero. memcpy_vector that I introduced is used in slightly a different way from the other so I don't think it's so simple applying your idea to these. > I have a linux-inspired proof-of-concept demo of this boot-time patching > at http://people.freebsd.org/~ssouhlal/testing/bootpatch-20060527.diff. > It prefetches the next element in the *_FOREACH() macros in sys/queue.h. > The patching that it does is to use PREFETCH instruction instead of > PREFETCHNTA if the cpu is found to support SSE2. It would be very appreciate to have it MI (yes, I mean MD + MI structure :PP) Attilio -- Peace can only be achieved by understanding - A. Einstein