Bug 90302

Summary: ATOMIC_OP_NEEDS_MEMORY_BARRIER configure check shouldn't be false for ARM
Product: cairo Reporter: Nathan Froyd <froydnj>
Component: generalAssignee: Chris Wilson <chris>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Nathan Froyd 2015-05-04 15:23:54 UTC
ATOMIC_OP_NEEDS_MEMORY_BARRIER, set by configure:

http://cgit.freedesktop.org/cairo/tree/build/aclocal.cairo.m4#n203

determines whether "atomic" loads need memory barriers prior to the load itself.  I assume this was put in for performance reasons.

From the above link, I can see that it's defined to false for x86/x86-64, which makes sense.  What seems suspicious is that it's also defined to false for ARM, which has much weaker memory ordering guarantees than x86 by default.
Comment 1 Bryce Harrington 2015-10-24 01:23:35 UTC
commit 7cc77d1ceea850d5728f4fad59ec18984dbc9ccb
Author:     Bryce Harrington <bryce@bryceharrington.org>
AuthorDate: Wed Oct 14 18:10:22 2015 -0700
Commit:     Bryce Harrington <bryce@bryceharrington.org>
CommitDate: Wed Oct 14 18:13:42 2015 -0700

    build: Use memory barriers for ARM

    ARM has much weaker memory ordering guarantees than x86 by default, and
    needs the memory barriers.  A similar fix exists in the Skia codebase.
    Fix suggested by Nathan Froyd.

    Fixes: FDO #90302

    Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
    Acked-by: "Henry (Yu) Song" <henry.song@samsung.com>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.