From owner-freebsd-arch@FreeBSD.ORG Tue Jan 16 22:52:43 2007 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB73316A47C for ; Tue, 16 Jan 2007 22:52:43 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.187]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC5813C47E for ; Tue, 16 Jan 2007 22:52:42 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id k27so19363nfc for ; Tue, 16 Jan 2007 14:52:42 -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=EK2dpa7MVFcU4pzYzUezhJIupCn4voKCLw2IdiUI+kDO8Y9LweK7wi4j8zkM4fffmf7v7pDXSC1WvLJfVaxCeD2dE67DPAOs3plv+n8Rr4qcclogjQ352X1Uv0WnabIGcC/OgrS9u0c+O7wwkEtxNdpwkzAKS8/RR2JYAsDa4oA= Received: by 10.49.94.18 with SMTP id w18mr9798nfl.1168987956450; Tue, 16 Jan 2007 14:52:36 -0800 (PST) Received: by 10.48.238.9 with HTTP; Tue, 16 Jan 2007 14:52:36 -0800 (PST) Message-ID: <3bbf2fe10701161452v1ca60470q3c26c31dd4bb4785@mail.gmail.com> Date: Tue, 16 Jan 2007 23:52:36 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "John Baldwin" In-Reply-To: <200701161605.22394.jhb@freebsd.org> 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> <200701161438.52481.jhb@freebsd.org> <3bbf2fe10701161236s48e6cc16p99c8c38c1d7becde@mail.gmail.com> <200701161605.22394.jhb@freebsd.org> X-Google-Sender-Auth: 23d6ed650ff311a4 Cc: Kip Macy , reebsd-current@freebsd.org, Pawel Jakub Dawidek , Suleiman Souhlal , freebsd-arch@freebsd.org Subject: Re: [PATCH] Mantaining turnstile aligned to 128 bytes in i386 CPUs 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: Tue, 16 Jan 2007 22:52:43 -0000 2007/1/16, John Baldwin : > On Tuesday 16 January 2007 15:36, Attilio Rao wrote: > > 2007/1/16, John Baldwin : > > > On Tuesday 16 January 2007 11:51, Attilio Rao wrote: > > > > 2006/7/28, Attilio Rao : > > > > > > > > > > After some thinking, I think it's better using init/fini methods > > > > > (since they hide the sizeof(struct turnstile) with size parameter). > > > > > > > > > > Feedbacks and comments are welcome: > > > > > http://users.gufi.org/~rookie/works/patches/uma_sync_init.diff > > > > > > > > [CC'ed all the interested people] > > > > > > > > Even if a long time is passed I did some benchmarks based on ebizzy > tool. > > > > This program claims to reproduce a real httpd server behaviour and is > > > > used into the Linux world for benchmarks, AFAIK. > > > > I think that results of the comparison on this patch is very > > > > interesting, and I think it worths a commit :) > > > > I think that results can be even better on a Xeon machine (I had no > > > > chance to reproduce this on some of these). > > > > (Results taken in consideration have been measured after some starts, > > > > in order to minimize caching differences). > > > > > > > > The patch: > > > > http://users.gufi.org/~rookie/works/patches/ts-sq/ts-sq.diff > > > > > > Looks good. Some minor nits are that in subr_turnstile.c in the comment I > > > would say "a turnstile is allocated" rather than "a turnstile is got from > a > > > specific UMA zone" as it reads a little bit clearer. Also, I would > > > say "Allocate a" rather than "Get a" for the two _alloc() functions. > Also, > > > why not just use UMA_ALIGN_CACHE and make UMA_ALIGN_CACHE (128 - 1) on > i386 > > > and amd64 rather than adding a new UMA_ALIGN_SYNC? > > > > I was thinking that in this way anyone who wants to replace the > > syncronizing primitive boundary to an appropriate value can do it. > > I just used UMA_ALIGN_CACHE as default value beacause I don't know the > > better boundary (for syncronizing primitives) for other arches. > > Is there a good reason to not cache-align synch primitives? That is, why > would an arch not use cache-align? Also, is there a reason to not update > UMA_ALIGN_CACHE on x86? Beacause the cache line varies between different CPU models of the same family. For example, L1, L2, L3 cache lines are 64 bytes wide on P4 and Xeon. L1 and L2 caches are 32 bytes wide on the other CPUs (P3, P2, etc.) and in particular they have nothing to do with trace cache line size that takes advanteges from this code. Attilio -- Peace can only be achieved by understanding - A. Einstein