From owner-freebsd-alpha Fri Jun 30 1:11:20 2000 Delivered-To: freebsd-alpha@freebsd.org Received: from teapot23.domain2.bigpond.com (teapot23.domain2.bigpond.com [139.134.5.165]) by hub.freebsd.org (Postfix) with SMTP id 8BE1D37B60C for ; Fri, 30 Jun 2000 01:11:17 -0700 (PDT) (envelope-from tpnelson@student.cowan.edu.au) Received: from localhost (localhost [127.0.0.1]) by teapot23.domain2.bigpond.com (NTMail 3.02.13) with ESMTP id ua780098 for ; Fri, 30 Jun 2000 18:10:41 +1000 Received: from WEBH-T-001-p-142-70.tmns.net.au ([139.134.142.70]) by mail2.bigpond.com (Claudes-Industrial-MailRouter V2.8a 3/312645); 30 Jun 2000 18:10:40 Message-ID: <395B0487.9D94D2A8@student.cowan.edu.au> Date: Thu, 29 Jun 2000 16:10:47 +0800 From: Trent Nelson X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: John Polstra Cc: alpha@freebsd.org Subject: Re: Cache line size for the Alpha References: <395A0EE8.28E6C524@student.cowan.edu.au> <200006291628.JAA23243@vashon.polstra.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org John Polstra wrote: > Now does anybody know whether it makes a difference performance-wise > to put spinlocks in separate cache lines on the Alpha? I understand > that it makes a big difference on the x86. But one person told me in > private mail that he didn't think it mattered on the Alpha. From the Alpha Architecture Handbook, v4.0, Appendix A.3: "Software locks are aligned quadwords and should be allocated to large cache blocks that either contain no other data or read-mostly data whose usage is correlated with the lock." [Pg. 279-280] From what I've read, I think the biggest performance consideration is the locality of the resource in contention. For high contention locks, it seems desirable to ensure that the spinlock code and the resource in contention are placed on separate 128-byte cache block boundaries. For locks with very low contention, where possible, it may be desirable to keep the resource in contention in the same line as the spinlock code. Appendix A.3.2 of the Alpha Architecture Handbook v4.0 deals with software locking implementations. Appendix C of the Compiler Writers' Guide to the 21264 deals with implementing optimal quadword aligned code for a tight loop. Both these and more can be retrieved from: ftp://ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.html Hope this helps. > John Regards, Trent. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message