From owner-svn-src-user@FreeBSD.ORG Wed Oct 24 14:34:36 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E80DADB; Wed, 24 Oct 2012 14:34:36 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1DF3F8FC1B; Wed, 24 Oct 2012 14:34:35 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id v11so757782vbm.13 for ; Wed, 24 Oct 2012 07:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=EjOkpqCJkGI3X09OEUp5McJ2GwOR0EYZP+iWmuJCzrs=; b=OyJixg4WQue/n5Hm0iNszQTYe86KejlbWP1L8sTRbqLfLy9bVEG0ws6K7NYRzcKqu2 Pkns5++pwjLmT/z6xOaMDCRXtEUe7iQ1GX67Z6XfZ6QH9v074+ViuCoKAKWJT5UwDBau 6qDTxWVl8JJPNcx7p8l1ivilJ6YeFBdVWvXldr8MijCFD6zL72TDBN61rW1EELH1EkNY A3yGC4CyA5y+P+RqxQ43Gn85CM0jVp4fw2pCtNO7WJjsOIdjELi8C4kgnePX3secxg1I dZpEVqPpvkyt9NCXkXaYnD4UNSp6ggx4EXmGjaVIJMX7RbjsAZ5k7eQ8XE+msJxsYmL6 T//A== MIME-Version: 1.0 Received: by 10.52.35.82 with SMTP id f18mr21399201vdj.99.1351089274927; Wed, 24 Oct 2012 07:34:34 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.220.150.197 with HTTP; Wed, 24 Oct 2012 07:34:34 -0700 (PDT) In-Reply-To: <201210241005.38977.jhb@freebsd.org> References: <201210221418.q9MEINkr026751@svn.freebsd.org> <50872624.6060901@freebsd.org> <201210241005.38977.jhb@freebsd.org> Date: Wed, 24 Oct 2012 15:34:34 +0100 X-Google-Sender-Auth: MAgQdehGFWD9luX6O3eh-_ECodE Message-ID: Subject: Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/... From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: mdf@freebsd.org, src-committers@freebsd.org, Andre Oppermann , Bruce Evans , svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 14:34:37 -0000 On Wed, Oct 24, 2012 at 3:05 PM, John Baldwin wrote: > On Tuesday, October 23, 2012 7:20:04 pm Andre Oppermann wrote: >> On 24.10.2012 00:15, mdf@FreeBSD.org wrote: >> > On Tue, Oct 23, 2012 at 7:41 AM, Andre Oppermann wrote: >> >> Struct mtx and MTX_SYSINIT always occur as pair next to each other. >> > >> > That doesn't matter. Language basics like variable definitions should >> > not be obscured by macros. It either takes longer to figure out what >> > a variable is (because one needs to look up the definition of the >> > macro) or makes it almost impossible (because now e.g. cscope doesn't >> > know this is a variable definition. >> >> Sigh, cscope doesn't expand macros? >> >> Is there a way to do the cache line alignment in a sane way without >> littering __aligned(CACHE_LINE_SIZE) all over the place? > > I was hoping to do something with an anonymous union or some such like: > > union mtx_aligned { > struct mtx; > char[roundup2(sizeof(struct mtx), CACHE_LINE_SIZE)]; > } > > I don't know if there is a useful way to define an 'aligned mutex' type > that will transparently map to a 'struct mtx', e.g.: > > typedef struct mtx __aligned(CACHE_LINE_SIZE) aligned_mtx_t; Unfortunately that doesn't work as I've verified with alc@ few months ago. The __aligned() attribute only works with structures definition, not objects declaration. Attilio -- Peace can only be achieved by understanding - A. Einstein