From owner-freebsd-arch@FreeBSD.ORG Tue Sep 18 16:04:51 2012 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1368C106566C; Tue, 18 Sep 2012 16:04:51 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id C396F8FC12; Tue, 18 Sep 2012 16:04:50 +0000 (UTC) Received: from critter.freebsd.dk (unknown [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id C682E3B75F; Tue, 18 Sep 2012 16:04:49 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.5/8.14.5) with ESMTP id q8IG4neE022352; Tue, 18 Sep 2012 16:04:49 GMT (envelope-from phk@phk.freebsd.dk) To: attilio@FreeBSD.org From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 18 Sep 2012 17:01:07 +0100." Content-Type: text/plain; charset=ISO-8859-1 Date: Tue, 18 Sep 2012 16:04:49 +0000 Message-ID: <22351.1347984289@critter.freebsd.dk> Cc: arch@FreeBSD.org Subject: Re: Aliasing issue with TAILQ on ppc64 ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 16:04:51 -0000 In message , Attilio Rao writes: >Yep, it likely means you need to use compiler memory barriers then. >I didn't look into details the implementation of TAILQ (but I can if >you want) Yes, It might be helpful if you knew what you were talking about, rather than shoot from the hip :-) > to point you precisely where, but it seems you already know >that code well enough to tell where. I know perfectly well where to insert the memory barrier. My point is that I don't think many people amongst our users would realize that you _need_ memory barriers when you need TAILQ's and I don't think I know of a single instance in our source tree that does... >TAILQ is certainly subjective to aliasing because it is inlined code, It's not inlining that makes it subject to aliasing, it's the casting. Please RTFC. >However, please note that this type of issue is not only related to >ppc64, but to all gcc/clang supported platforms. Which is very much why I bloody raise it on arch@ in the first place. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.