From owner-freebsd-tinderbox@FreeBSD.ORG Wed Jun 3 23:35:37 2009 Return-Path: Delivered-To: tinderbox@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60FFC106564A; Wed, 3 Jun 2009 23:35:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 374218FC15; Wed, 3 Jun 2009 23:35:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id CE13046B2C; Wed, 3 Jun 2009 19:35:36 -0400 (EDT) Date: Thu, 4 Jun 2009 00:35:36 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Marcel Moolenaar In-Reply-To: <15550775-6B8A-414E-A579-8B518D62E06E@mac.com> Message-ID: References: <20090602222445.2F6017302F@freebsd-current.sentex.ca> <15550775-6B8A-414E-A579-8B518D62E06E@mac.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: kmacy@freebsd.org, marius@freebsd.org, FreeBSD Tinderbox , sparc64@freebsd.org, Eygene Ryabinkin , current@freebsd.org Subject: Re: [head tinderbox] failure on sparc64/sun4v X-BeenThere: freebsd-tinderbox@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Tinderbox reports, responses, and meta-comments" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 23:35:38 -0000 On Wed, 3 Jun 2009, Marcel Moolenaar wrote: >> Is there a reason not just to use __aligned(64) or the like on the first >> entry of the MD PCPU structure for sun4v to avoid future MI pcpu changes >> from causing similar discomfort for the MD pcpu parts? Also, do we know >> why these alignment/sizing requirements exist for struct pcpu on sun4v but >> not other platforms? If this is about packing pcpu structures into >> properly aligned cache lines, again __aligned() might be the right approach >> to take... > > Adding __aligned(xx) doesn't make it aligned. For example, malloc(3) only > aligns at 16-byte boundaries, so any user-space structure that has > __aligned(x>16) must manually make sure that this is actually the case by > over-allocating and then adjusting the pointer to an x>16 aligned address. > Likewise for the kernel, though it's easier in the kernel to get something > that's page-aligned... FYI, I wan't sure if that was the problem that caused the alignment code in this case. However, I agree that malloc(9)'s lack of alignment support is a problem, and one that should be pretty easy to resolve by simply putting a bit of over-allocation code in malloc(9), and adding a malloc_aligned(9) variation, or perhaps just an M_CACHEALIGN flag. Robert N M Watson Computer Laboratory University of Cambridge