From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 15 21:21:28 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 640C5106566C; Thu, 15 Sep 2011 21:21:28 +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 3ECF08FC15; Thu, 15 Sep 2011 21:21:28 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id B92E646B3B; Thu, 15 Sep 2011 17:21:27 -0400 (EDT) Date: Thu, 15 Sep 2011 22:21:27 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: "K. Macy" In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: FreeBSD Hackers , Arnaud Lacombe Subject: Re: buf_ring(9) API precisions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2011 21:21:28 -0000 On Thu, 15 Sep 2011, K. Macy wrote: >> Why are you making an MD guess, the amount of padding to fit the size of a >> cache line, in MI API ? Strangely enough, you did not make this assumption >> in, say r205488 (picked randomly). > > It has been several years, and I haven't done any work in svn in over a > year, I don't remember. I probably meant to refine it in a later iteration. > > If you would like to send me a patch addressing this I'd be more than happy > to apply it if appropriate. Otherwise, I will deal with it some time after 9 > settles. > > Thanks for pointing this out. I'm not sure if gcc (and friends) allow __aligned(CACHE_LINE_SIZE) to be used on individual elements of a struct (causing appropriate padding to be added), but that may be one option here. Of course, that introduces a further alignment requirement on the struct itself, so a moderate amount of care would need to be used. Robert