From owner-freebsd-current@FreeBSD.ORG Wed Jan 17 21:15:10 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21F1B16A40F for ; Wed, 17 Jan 2007 21:15:10 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by mx1.freebsd.org (Postfix) with ESMTP id 9EEC713C46A for ; Wed, 17 Jan 2007 21:15:09 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id k27so299356nfc for ; Wed, 17 Jan 2007 13:15:08 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=eRHA2G6sBSGuU/pxc8QwbYPRDp+e254PBnXyNIbj6NWRafkXrTOCX/187SbMoh5DzEJ9GTJmsKzUPrUoWtQ6WiS2Bx4QC5QaAEzpsIPA4DIDz9BreSVKo2hrgQ0qXpWQqUHzqWzYhB9TK/rdDuVF00apNH41aZlrEjwVlXuEtTs= Received: by 10.48.48.13 with SMTP id v13mr11083nfv.1169068508050; Wed, 17 Jan 2007 13:15:08 -0800 (PST) Received: by 10.48.238.9 with HTTP; Wed, 17 Jan 2007 13:15:07 -0800 (PST) Message-ID: <3bbf2fe10701171315g696bca4fi3bf676b62c06f4d@mail.gmail.com> Date: Wed, 17 Jan 2007 22:15:07 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Ivan Voras" In-Reply-To: <45AE7BF8.10703@fer.hr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3bbf2fe10607250813w8ff9e34pc505bf290e71758@mail.gmail.com> <20070117134022.V18339@besplex.bde.org> <20070117224812.Q23194@besplex.bde.org> <45AE7BF8.10703@fer.hr> X-Google-Sender-Auth: 540a52cd6fbe718e Cc: freebsd-current@freebsd.org, Bruce Evans , freebsd-arch@freebsd.org Subject: Re: Optimized copy&move (was: Re: [PATCH] Mantaining turnstile aligned to 128 bytes in i386 CPUs) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2007 21:15:10 -0000 2007/1/17, Ivan Voras : > Bruce Evans wrote: > > > And MMX/XMM registers ar not needed to get movnt on machines with SSE2, > > since movnti is part of SSE2. This reduces the advantages of using MMX/XMM > > registers on P4's and A64's in 32-bit mode to the non-nt parts of the > > above (fully cached case), which I think are less important than the nt > > parts. > > Hmm, I'm looking at i386/i386/support.s and there are several versions > of bcopy and bmove functions, including some that optimize by using FPU > registers (large_i586_bcopy_loop), and a version that uses movnti > (sse2_pagezero), but I can't find the bit of magic which glues them to > bzero() call. > > Also, as as I can tell by the comments, the FPU version works by > manually saving context... why is this possible (i.e. won't something > preempt it?) They are just broken. My implementation, which follows DragonFlyBSD patterns, just use a bts (which is atomic) in order to set a "lock" and avoid thread migration with scheduler pinning. This is enough to solve concurrency problems. Attilio -- Peace can only be achieved by understanding - A. Einstein