[Nouveau] [PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
Patrick Baggett
baggett.patrick at gmail.com
Wed Feb 25 11:04:10 PST 2015
On Wed, Feb 25, 2015 at 11:55 AM, Maarten Lankhorst <
maarten.lankhorst at canonical.com> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20150225/2ca925ce/attachment.html>
More information about the Nouveau
mailing list