From owner-svn-src-user@FreeBSD.ORG Wed Oct 24 19:38:01 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 310DF699 for ; Wed, 24 Oct 2012 19:38:01 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 897998FC12 for ; Wed, 24 Oct 2012 19:38:00 +0000 (UTC) Received: (qmail 35408 invoked from network); 24 Oct 2012 21:15:46 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 24 Oct 2012 21:15:46 -0000 Message-ID: <5088438B.90204@freebsd.org> Date: Wed, 24 Oct 2012 21:37:47 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: attilio@FreeBSD.org 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/... References: <201210221418.q9MEINkr026751@svn.freebsd.org> <50872624.6060901@freebsd.org> <201210241005.38977.jhb@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: mdf@freebsd.org, src-committers@freebsd.org, Bruce Evans , John Baldwin , svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list 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 19:38:01 -0000 On 24.10.2012 16:34, Attilio Rao wrote: > On Wed, Oct 24, 2012 at 3:05 PM, John Baldwin wrote: >> On Tuesday, October 23, 2012 7:20:04 pm Andre Oppermann wrote: >>> 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. There is a huge amount of false cache line sharing in the .bss section: ffffffff81515980 B accept_mtx ffffffff815159a0 B maxsockets ffffffff815159a8 B socket_zone ffffffff815159b0 B so_gencnt ffffffff815159b8 B sysctl__kern_ipc_children accept_mtx, socket_zone and so_gencnt are frequently accessed but not related to each other and on different code path's. There is a lot of pointless cache dirtying going on. Example randomly picked from "nm -n kernel.debug". -- Andre