Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Sep 2012 16:04:49 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        attilio@FreeBSD.org
Cc:        arch@FreeBSD.org
Subject:   Re: Aliasing issue with TAILQ on ppc64 ?
Message-ID:  <22351.1347984289@critter.freebsd.dk>
In-Reply-To: Your message of "Tue, 18 Sep 2012 17:01:07 %2B0100." <CAJ-FndAwUDJsJZNqihzdfz60UEhS75oOYijjb7LAzT%2Bwx1V6DA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <CAJ-FndAwUDJsJZNqihzdfz60UEhS75oOYijjb7LAzT+wx1V6DA@mail.gmail.com>
, 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?22351.1347984289>