On Wed, Feb 25, 2015 at 11:55 AM, Maarten Lankhorst <
[email protected]> wrote:

>
>
> On 25-02-15 18:26, Patrick Baggett wrote:
> >>
> >>
> >> In general things don't get optimized across function calls, except in
> >> case of inlinable functions.
> >>
> >> And for compiler attributes it's the opposite,__attribute__((const)) and
> >> __attribute((pure)) can be used to indicate some kind of safety to
> optimize
> >> across functions.
> >>
> >> https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
> >>
> >> This is true, but LTO increases the compiler's ability to make these
> sorts
> > of optimizations across function calls and even C source file boundaries
> > without you needing to explicitly mark functions as such.
> Even if pthread_mutex_lock was completely inlined there would still be a
> asm volatile(("" ::: "memory")) in there acting as a complete memory
> barrier to the compiler.
>

I agree with your conclusion and I agree then that the patch can stand
as-is without any changes I proposed. I don't really think "memory barrier"
is the right word though, not that it matters. It's more like "all writes
need to finish and all *previous reads are* *invalid*". Anyways, you've
definitely proven to me that the solution is fine.
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

Reply via email to