From owner-freebsd-hackers@FreeBSD.ORG Wed May 31 23:32:15 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E583616C192 for ; Wed, 31 May 2006 23:32:15 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E3BA43D81 for ; Wed, 31 May 2006 23:32:13 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: by wx-out-0102.google.com with SMTP id i31so106069wxd for ; Wed, 31 May 2006 16:32:12 -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=eaKw2a805ufMILLL2K3Hs59kLRFyMPKbrSjXEt4gpxSWhtqLPsY7VtfXNq0oTfNg1cyQ8QSJNZcY4Upm78CYHs+g1+w/BYnZmwiVlKRIrZPY8RBpn65CRgT9CnxfLdqmJ29WGl3hJif088OnQ5FtVbH6W9Mi5NCwZoM+oiU45OU= Received: by 10.70.72.13 with SMTP id u13mr875681wxa; Wed, 31 May 2006 16:32:12 -0700 (PDT) Received: by 10.70.11.2 with HTTP; Wed, 31 May 2006 16:32:12 -0700 (PDT) Message-ID: <3bbf2fe10605311632w58c2949buc072e58ac103d7d@mail.gmail.com> Date: Thu, 1 Jun 2006 01:32:12 +0200 From: "Attilio Rao" To: "Bruce Evans" , "Suleiman Souhlal" , freebsd-arch@freebsd.org, freebsd-hackers@freebsd.org In-Reply-To: <20060601084052.D32549@delplex.bde.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> <3bbf2fe10605311329h7adc1722j9088253515e0265b@mail.gmail.com> <20060601084052.D32549@delplex.bde.org> Cc: Subject: Re: [patch] Adding optimized kernel copying support - Part III X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rookie@gufi.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2006 23:32:24 -0000 2006/6/1, Bruce Evans : > > >> 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). > > Er, isn't its main point to fix some !SMP assumptions made in the old > copying-through-the-FPU code? (The old code is messy due to its avoidance > of global changes. It wants to preserve the FPU state on the stack, but > this doesn't quite work so it does extra things (still mostly locally) > that only work in the !SMP && (!SMPng even with UP) case. Patching this > approach to work with SMP || SMPng cases would make it messier.) > > The new code wouldn't behave much differently under SMP. It just might > be a smaller optimization because more memory pressure for SMP causes > more cache misses for everything and there are no benefits from copying > through MMX/XMM unless nontemporal writes are used. All (?) CPUs with > MMX or SSE* can saturate main memory using 32-bit instructions. On > 32-bit CPUs, the benefits of using MMX/XMM come from being able to > saturate the L1 cache on some CPUs (mainly Athlons and not P[2-4]), > and from being able to use nontemporal writes on some CPUs (at least > AthlonXP via SSE extensions all CPUs with SSE2). I was just speaking about the copying routine itself and not about the SSE2 environment preserving mechanism. It remains untouched in SMP case. However I need to say you were right when you suggested me to merge anything in support.s since it has a more coherent design. Attilio -- Peace can only be achieved by understanding - A. Einstein